// Example by Krister Olsson
import krister.Ess.*;
AudioChannel myChannel;
void setup() {
// start up Ess
Ess.start(this);
// load "cell.aif" into a new AudioChannel
myChannel=new AudioChannel("cell.aif");
// pan left
myChannel.pan(Ess.LEFT);
// play
myChannel.play();
// pan right over the duration of the sound
myChannel.panTo(Ess.RIGHT,myChannel.duration);
}
void draw() {
}
void keyPressed() {
// stop the pan and leave it where it is
myChannel.stopPan();
}
// we are done, clean up Ess
public void stop() {
Ess.stop();
super.stop();
}
|