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