// print the default volume 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.aiff");
float vol = mySample.getVolume();
println("the sample's volume is:" + vol); // prints '1.0' for default volume.
}
// safely stop the Sonia engine upon shutdown.
public void stop(){
Sonia.stop();
super.stop();
}
|