The OscillatorNode interface represents a periodic waveform, like a sine wave. It is an AudioNode audio-processing module that causes a given frequency of sine wave to be created — in effect, a constant tone.
The onended property of the OscillatorNode interface is used to set the event handler for the ended event, which fires when the tone has stopped playing.
The setPeriodicWave() method of the OscillatorNode interface is used to point to a PeriodicWave defining a periodic waveform that can be used to shape the oscillator's output, when type = "custom" is used.
The following example shows basic usage of an AudioContext to create an oscillator node. For an applied example, check out our Violent Theremin demo (see app.js for relevant code).
The following example shows basic usage of an AudioContext to create an oscillator node. For an applied example, check out our Violent Theremin demo (see app.js for relevant code).