The AudioScheduledSourceNode
interface—part of the Web Audio API—is a parent interface for several types of audio source node interfaces which share the ability to be started and stopped, optionally at specified times. Specifically, this interface defines the start()
and stop()
methods, as well as the onended
event handler.
You can't create an AudioScheduledSourceNode
object directly. Instead, use the interface which extends it, such as AudioBufferSourceNode
, OscillatorNode
, and ConstantSourceNode
.
Unless stated otherwise, nodes based upon AudioScheduledSourceNode
output silence when not playing (that is, before start()
is called and after stop()
is called). Silence is represented, as always, by a stream of samples with the value zero (0).
Properties
Inherits properties from its parent interface, AudioNode
.
Methods
Inherits methods from its parent interface, AudioNode
, and adds the following methods:
start()
- Schedules the node to begin playing the constant sound at the specified time. If no time is specified, the node begins playing immediately.
stop()
- Schedules the node to stop playing at the specified time. If no time is specified, the node stops playing at once.
Events
Listen to these events using addEventListener()
or by assigning an event listener to the oneventname
property of this interface:
ended
- Fired when the source node has stopped playing, either because it's reached a predetermined stop time, the full duration of the audio has been performed, or because the entire buffer has been played.
Also available using theonended
event handler property.
Specification
Specification | Status | Comment |
---|---|---|
Web Audio API The definition of 'AudioScheduledSourceNode' in that specification. |
Working Draft |
Browser compatibility
Desktop | Mobile | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|
AudioScheduledSourceNode | Chrome
Full support
57
| Edge Full support ≤79 | Firefox
Full support
53
| IE No support No | Opera
Full support
44
| Safari ? | WebView Android
Full support
57
| Chrome Android
Full support
57
| Firefox Android
Full support
53
| Opera Android
Full support
44
| Safari iOS ? | Samsung Internet Android
Full support
7.0
|
ended event | Chrome Full support 14 | Edge Full support ≤79 | Firefox Full support 53 | IE No support No | Opera Full support 15 | Safari ? | WebView Android Full support Yes | Chrome Android Full support 18 | Firefox Android Full support 25 | Opera Android Full support 14 | Safari iOS ? | Samsung Internet Android Full support 1.0 |
onended | Chrome Full support 14 | Edge Full support ≤79 | Firefox Full support 53 | IE No support No | Opera Full support 15 | Safari ? | WebView Android Full support Yes | Chrome Android Full support 18 | Firefox Android Full support 25 | Opera Android Full support 14 | Safari iOS ? | Samsung Internet Android Full support 1.0 |
start | Chrome Full support 14 | Edge Full support ≤79 | Firefox Full support 53 | IE No support No | Opera Full support 15 | Safari ? | WebView Android Full support Yes | Chrome Android Full support 18 | Firefox Android Full support 25 | Opera Android Full support 14 | Safari iOS ? | Samsung Internet Android Full support 1.0 |
stop | Chrome Full support 14 | Edge Full support ≤79 | Firefox Full support 53 | IE No support No | Opera Full support 15 | Safari ? | WebView Android Full support Yes | Chrome Android Full support 18 | Firefox Android Full support 25 | Opera Android Full support 14 | Safari iOS ? | Samsung Internet Android Full support 1.0 |
Legend
- Full support
- Full support
- No support
- No support
- Compatibility unknown
- Compatibility unknown
- Uses a non-standard name.
- Uses a non-standard name.