// Example by Krister Olsson
import krister.Ess.*;
AudioChannel myChannel;
void setup() {
size(256,200);
// start up Ess
Ess.start(this);
// load "cell.aif" into a new AudioChannel
myChannel=new AudioChannel("cell.aif");
// add an additional 3 seconds to the beginning
myChannel.adjustChannel(myChannel.frames(3000),Ess.BEGINNING);
// set the in loop point to 0
myChannel.in(0);
// set the out loop point to the new end of the sound
myChannel.out(myChannel.size);
// start the sound looping forever
myChannel.play(Ess.FOREVER);
}
void draw() {
}
// we are done, clean up Ess
public void stop() {
Ess.stop();
super.stop();
}
|