[求助]Processing里声音的播放问题
processing吧
全部回复
仅看楼主
level 1
hanbostu 楼主
是在看learning processing时学的处理声音的程序,怎么都调试不出来,红字提醒的错误是:
“Could not load native library for JSyn V142
com.softsynth.jsyn.SynthException: JSyn error: Could not access JSyn synthesis engine. - JSyn not properly installed, or web page is not calling smart_embed_jsyn.js!, 0x0=0, 0x0=0
Sonia: Please make sure you have entered the correct Sample file name to load

源程序如下,麻烦大神指导一下究竟是为什么?是不是我系统升了EI Captian的缘故?
import pitaru.sonia_v2_9.*;
// A Sample object (for a sound)
Sample tone;
void setup(){
size(200,200);
Sonia.start(this);
// Create a new sample object.
tone = new Sample("ding.wav");
// Loop the sound forever
// (well, at least until stop() is called)
tone.repeat();
smooth();
}
void draw() {
if (tone.isPlaying()) {
background(255); } else {
background(100);
}
// Set the volume to a range between 0 and 1.0
float ratio = (float) mouseX/width;
tone.setVolume(ratio);
// Set the rate to a range between 0 and 88,200
// Changing the rate alters the pitch
ratio = (float) mouseY/height;
tone.setRate(ratio*88200);
// Draw some rectangles to show what is going on
stroke(0);
fill(175);
rect(0,160,mouseX,20);
stroke(0);
fill(175);
rect(160,0,20,mouseY);
}
// Pressing the mouse stops and starts the sound
void mousePressed() {
if (tone.isPlaying()) {
tone.stop();
} else { tone.repeat();
} }
// Close the sound engine
public void stop(){
Sonia.stop();
super.stop();
}
2015年12月11日 03点12分 1
1