 |
 |
 |
 |
| Class |
|
AudioChannel |
 |
|
|
| Name |
|
fadeTo() |
 |
|
|
| Examples |
|
// 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();
}
|
|
|
| Description |
|
Adjusts an AudioChannel's volume over a period of milliseconds. Runs in its own thread so other code may be executed simultaneously |
 |
|
|
| Syntax |
|
channel.fadeTo(volume, ms)
channel.fadeTo(volume, ms, type)
|
 |
|
|
| Parameters |
|
| channel |
|
any instance of AudioChannel
|
| volume |
|
float: the target volume (between 0 and 1)
|
| ms |
|
int: the number of milliseconds over which to adjust the volume
|
| type |
|
the type of fade: Ess.LINEAR (the default), Ess.SLOW, or Ess.FAST
|
|
 |
|
|
| Returns |
|
nothing |
 |
|
|
| Usage |
|
Web & Application |
 |
|
|
|
|