start
Summary
Schedules a sound to playback at an exact time.
Method of apis/webaudio/OscillatorNodeapis/webaudio/OscillatorNode
Syntax
var = OscillatorNode.start(when);
Parameters
when
- Data-type
- Number
Describes at what time (in seconds) the sound should start playing. It is in the same time coordinate system as AudioContext.currentTime. If 0 is passed in for this value or if the value is less than currentTime, then the sound will start playing immediately. start may only be called one time and must be called before stop is called or an exception will be thrown.
Return Value
Returns an object of type
Examples
var oscillator = audioCtx.createOscillator();
oscillator.type = 'square';
oscillator.frequency.value = 3000; // value in hertz
oscillator.start(); // start playing immediately
Related specifications
- W3C Web Audio API
- W3C Editor’s Draft