Class DelayNode
java.lang.Object
com.codename1.media.audio.AudioNode
com.codename1.media.audio.DelayNode
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 Summary
Modifier and TypeMethodDescriptionThe delay in seconds, 0 by default, up to the maximum; an audio rate parameter.doubleThe longest delay this node supports.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
-
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
-