public class AudioContextStopTrigger extends Bead
AudioContext
to stop in response to a given event.
For example, to cause the AudioContext
to stop when a sample has finished playing:
AudioContext context = new AudioContext();
SamplePlayer samplePlayer = new SamplePlayer(SampleManager.sample(pathToAudioFile));
context.out.addInput(samplePlayer);
samplePlayer.setKillListener(new AudioContextStopTrigger(context));
context.start();
Constructor and Description |
---|
AudioContextStopTrigger(AudioContext ac)
Creates a new audio context stop trigger.
|
Modifier and Type | Method and Description |
---|---|
void |
kill()
Stops this Bead, and flags it as deleted.
|
void |
messageReceived(Bead message)
Responds to an incoming message.
|
public AudioContextStopTrigger(AudioContext ac)
ac
- the AudioContext.public void messageReceived(Bead message)
Bead
messageReceived
in class Bead
message
- the message