// Example by Krister Olsson
import krister.Ess.*;
AudioChannel myChannel;
FadeOut myFadeOut;
void setup() {
size(256,200);
// start up Ess
Ess.start(this);
// load "cell.aif" into a new AudioChannel
myChannel=new AudioChannel("cell.aif");
// fade out slow for the first 2 seconds
myFadeOut=new FadeOut(Ess.SLOW);
myFadeOut.filter(myChannel,0,myChannel.frames(2000));
// then fade out again fast for the next 2 seconds
myFadeOut.curve=Ess.FAST;
myFadeOut.filter(myChannel,myChannel.frames(2000),myChannel.frames(2000));
// play
myChannel.play();
}
void draw() {
}
// we are done, clean up Ess
public void stop() {
Ess.stop();
super.stop();
}
|