W3cubDocs

/Haxe JavaScript

OscillatorNode

package js.html.audio

extends AudioNodeEventTarget

@:native("OscillatorNode") Available on js

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.

Documentation OscillatorNode by Mozilla Contributors, licensed under CC-BY-SA 2.5.

See:

Variables

read only detune:AudioParam

An a-rate AudioParam representing detuning of oscillation in cents (though the AudioParam` returned is read-only, the value it represents is not.)

read only frequency:AudioParam

An a-rate AudioParam representing the frequency of oscillation in hertz (though the AudioParam` returned is read-only, the value it represents is not.)

onended:Function

type:OscillatorType

Represents the shape of the oscillator wave generated. Different waves will produce different tones.

Methods

setPeriodicWave (periodicWave:PeriodicWave):Void

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. This replaces the now-obsolete OscillatorNode.setWaveTable.

@:value({ when : 0.0 }) start (when:Float = 0.0):Void

Throws:

null DOMError

@:value({ when : 0.0 }) stop (when:Float = 0.0):Void

Throws:

null DOMError

© 2005–2018 Haxe Foundation
Licensed under a MIT license.
https://api.haxe.org/js/html/audio/OscillatorNode.html