// Print the number of total frames in the Sample object.
// Notes: - a 44100 Hz (44.1 kHz) sample has 44100 frames stored for each second.
// - Make sure to include the specified audio file in your project's 'data' folder.
Sample mySample;
int totalFrames;
void setup() {
size(100,100);
Sonia.start(this);
mySample = new Sample("sine.aiff");
totalFrames = mySample.getNumFrames();
println("the number of frames in the sample is:" + totalFrames);
}
// safely stop the Sonia engine upon shutdown.
public void stop(){
Sonia.stop();
super.stop();
}
|