Class AudioScheduledSourceNode

java.lang.Object
com.codename1.media.audio.AudioNode
com.codename1.media.audio.AudioScheduledSourceNode
Direct Known Subclasses:
AudioBufferSourceNode, ConstantSourceNode, OscillatorNode

public abstract class AudioScheduledSourceNode extends AudioNode
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 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

      public void setOnEnded(Runnable onEnded)

      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 an OfflineAudioContext.

      Parameters
      • onEnded: the callback, or null