// 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");
// play
myChannel.play();
// fade to silence over 5 seconds
myChannel.fadeTo(0,5000);
print("Starting fade");
// slow the framerate
framerate(1);
}
void draw() {
// are we fading?
if (myChannel.fading) print(".");
}
void audioOutputFade(AudioOutput ch) {
print("done!");
}
// we are done, clean up Ess
public void stop() {
Ess.stop();
super.stop();
}
|