Class DelayNode

java.lang.Object
com.codename1.media.audio.AudioNode
com.codename1.media.audio.DelayNode

public final class DelayNode extends AudioNode

Delays its input by getDelayTime(), the Web Audio DelayNode. Fractional delays are linearly interpolated.

A delay is the only node that may close a cycle, as in a feedback echo:

OfflineAudioContext audio = new OfflineAudioContext(2, 44100, 44100);
OscillatorNode source = audio.createOscillator();
DelayNode echo = audio.createDelay(1);
echo.getDelayTime().setValue(0.3f);
GainNode feedback = audio.createGain();
feedback.getGain().setValue(0.4f);
source.connect(echo).connect(feedback).connect(echo);
echo.connect(audio.getDestination());

Inside a cycle the delay cannot be shorter than one render quantum (128 frames), as the specification requires.

  • Method Details

    • getDelayTime

      public AudioParam getDelayTime()

      The delay in seconds, 0 by default, up to the maximum; an audio rate parameter.

      Returns

      the parameter

    • getMaxDelayTime

      public double getMaxDelayTime()

      The longest delay this node supports.

      Returns

      seconds