Class AudioScheduledSourceNode
java.lang.Object
com.codename1.media.audio.AudioNode
com.codename1.media.audio.AudioScheduledSourceNode
- Direct Known Subclasses:
AudioBufferSourceNode, ConstantSourceNode, OscillatorNode
A source node that is started and stopped at scheduled times, the Web Audio
AudioScheduledSourceNode. A source can be started only once; create a new
one to play again.-
Method Summary
Modifier and TypeMethodDescriptionvoidsetOnEnded(Runnable onEnded) Sets what runs when the source stops playing, either because it reached its stop time or because it ran out of audio.voidstart()Starts playing now.voidstart(double when) Starts playing atwhen; a time already past starts at once.voidstop()Stops playing now.voidstop(double when) Stops playing atwhen.Methods inherited from class AudioNode
connect, connect, connect, connect, disconnect, disconnect, disconnect, disconnect, disconnect, getChannelCount, getChannelCountMode, getChannelInterpretation, getContext, getNumberOfInputs, getNumberOfOutputs, setChannelCount, setChannelCountMode, setChannelInterpretation
-
Method Details
-
start
public void start()Starts playing now. -
start
public void start(double when) Starts playing at
when; a time already past starts at once.Parameters
when: context time in seconds
-
stop
public void stop()Stops playing now. -
stop
public void stop(double when) Stops playing at
when. Calling it again replaces the earlier stop time.Parameters
when: context time in seconds
-
setOnEnded
Sets what runs when the source stops playing, either because it reached its stop time or because it ran out of audio. It runs on the EDT for an
AudioContext, and on the rendering thread, between render quanta, for anOfflineAudioContext.Parameters
onEnded: the callback, or null
-