// Example by Krister Olsson
import krister.Ess.*;
AudioChannel myChannel;
void setup() {
size(256,200);
// start up Ess
Ess.start(this);
// create a new AudioChannel with 1000 frames
myChannel=new AudioChannel(1000);
// set the sample rate to 44.1kHz
myChannel.sampleRate(44100);
// convert 5 seconds at myChannel's sample rate to sample frames
int frames=myChannel.frames(5000);
println(frames);
}
void draw() {
}
// we are done, clean up Ess
public void stop() {
Ess.stop();
super.stop();
}
|