// Print the default speed of the sample object.
// Notes: Make sure to include the specified audio file in your project's 'data' folder.
Sample mySample;
void setup() {
size(100,100);
Sonia.start(this);
mySample = new Sample("sine.aif");
float speed = mySample.getSpeed();
println("the sample's speed is:" + speed); // prints '1.0' as the speed has not changed.
}
// safely stop the Sonia engine upon shutdown.
public void stop(){
Sonia.stop();
super.stop();
}
|