// 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");
// change the sample rate (changing pitch and duration)
myChannel.sampleRate(11025,false);
// change the sample rate (maintaining pitch and duration)
myChannel.sampleRate(44100,true);
// play
myChannel.play();
}
void draw() {
}
// we are done, clean up Ess
public void stop() {
Ess.stop();
super.stop();
}
|