files/en-us/web/api/audioscheduledsourcenode/start/index.md
{{APIRef("Web Audio API")}}
The start() method on {{domxref("AudioScheduledSourceNode")}} schedules a sound to begin playback at the specified time.
If no time is specified, then the sound begins playing immediately.
start()
start(when)
when {{optional_inline}}
when parameter entirely) causes the sound to
start playback immediately.None ({{jsxref("undefined")}}).
InvalidStateNode {{domxref("DOMException")}}
when is negative.This example demonstrates how to create an {{domxref("OscillatorNode")}} which is scheduled to start playing in 2 seconds and stop playing 1 second after that. The times are calculated by adding the desired number of seconds to the context's current time stamp returned by {{domxref("BaseAudioContext/currentTime", "AudioContext.currentTime")}}.
context = new AudioContext();
osc = context.createOscillator();
osc.connect(context.destination);
/* Schedule the start and stop times for the oscillator */
osc.start(context.currentTime + 2);
osc.stop(context.currentTime + 3);
{{Specifications}}
{{Compat}}