MediaStreamAudioSourceNode interface is a type of
AudioNode which operates as an audio source whose media is received from a
MediaStream obtained using the WebRTC or Media Capture and Streams APIs.
MediaStreamAudioSourceNode has no inputs and exactly one output, and is created using the
The number of channels output by the node matches the number of tracks found in the selected audio track.
|Number of inputs||
|Number of outputs||
defined by the first audio
Creates a new
MediaStreamAudioSourceNodeobject instance with the specified options.
In addition to the following properties,
MediaStreamAudioSourceNode inherits the properties of its parent,
Inherits methods from its parent,
The stream specified by the
mediaStreamparameter does not contain any audio tracks.
For the purposes of the
MediaStreamTrackAudioSourceNode interface, the order of the audio tracks on the stream is determined by taking the tracks whose
audio, then sorting the tracks by their
id property's values, in Unicode code point order (essentially, in alphabetical or lexicographical order, for IDs which are simple alphanumeric strings).
The first track, then, is the track whose
id comes first when the tracks' IDs are all sorted by Unicode code point.
However, it's important to note that the rule establishing this ordering was added long after this interface was first introduced into the Web Audio API. As such, you can't easily rely on the order matching between any two browsers or browser versions.
MediaStreamTrackAudioSourceNode interface is similar to
MediaStreamAudioSourceNode, but avoids this problem by letting you specify which track you want to use.
AudioContext.createMediaStreamSource() for example code that uses this object.
|Web Audio API |
BCD tables only load in the browser