MediaStreamAudioSourceNode: mediaStream property
Baseline Widely available
This feature is well established and works across many devices and browser versions. It’s been available across browsers since July 2020.
TheMediaStreamAudioSourceNode interface'sread-onlymediaStream property indicates theMediaStream that contains the audio track from which the node isreceiving audio.
This stream was specified when the node was first created,either using theMediaStreamAudioSourceNode()constructor or theAudioContext.createMediaStreamSource() method.
In this article
Value
AMediaStream representing the stream which contains theMediaStreamTrack serving as the source of audio for the node.
Theuser agent uses the first audio track it finds on the specifiedstream as the audio source for this node. However, there is no way to be certain whichtrack that will be on multi-track streams. If the specific track matters to you, or youneed to have access to the track itself, you should use aMediaStreamTrackAudioSourceNode instead.
Examples
const audioCtx = new window.AudioContext();let options = { mediaStream: stream,};let source = new MediaStreamAudioSourceNode(audioCtx, options);console.log(source.mediaStream);Specifications
| Specification |
|---|
| Web Audio API> # dom-mediastreamaudiosourcenode-mediastream> |