// Print the current status of the sample.
// Notes: Make sure to include the specified audio file in your project's 'data' folder.
boolean doOnce;
Sample mySample;
void setup() {
size(100,100);
Sonia.start(this);
doOnce = true;
mySample = new Sample("sine.aiff");
mySample.play();
}
void loop(){
if(mySample.isPlaying()){
print("...Sample is playing...");
} else if(!mySample.isPlaying() && doOnce){
print("...Sample has stopped...");
doOnce = false;
}
}
public void stop(){
Sonia.stop();
super.stop();
}
|