// 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 88200 sample frames at myChannel's sample rate to milliseconds
int ms=myChannel.ms(88200);
println(ms);
}
void draw() {
}
// we are done, clean up Ess
public void stop() {
Ess.stop();
super.stop();
}
|