OscillatorNode
Summary
OscillatorNode represents an audio source generating a periodic waveform. It can be set to a few commonly used waveforms. Additionally, it can be set to an arbitrary periodic waveform through the use of a WaveTable object. Oscillators are common foundational building blocks in audio synthesis.
Properties
- detune
- A detuning value (in cents) which will offset the frequency by the given amount. This parameter is a-rate.
- frequency
- The frequency (in Hertz) of the periodic waveform. This parameter is a-rate.
- playbackState
- The playback state, initialized to UNSCHEDULED_STATE, progressing through SCHEDULED_STATE, PLAYING_STATE, and FINISHED_STATE. Not in spec; deletion candidate. See http://webaudio.github.io/web-audio-api/.
- type
- The shape of the periodic waveform. It may directly be set to any of the type constant values except for CUSTOM. The setWaveTable() method can be used to set a custom waveform, which results in this attribute being set to CUSTOM.
Methods
- setWaveTable
- Sets an arbitrary custom periodic waveform given a WaveTable. Not in spec; deletion candidate. See http://webaudio.github.io/web-audio-api/.
- start
- Schedules a sound to playback at an exact time.
- stop
- Schedules a sound to stop playback at an exact time.
Events
No events.
Related specifications
- W3C Web Audio API
- W3C Editor’s Draft