Web Audio API
The MediaElementAudioSourceNode() constructor creates a new MediaElementAudioSourceNode object instance.
Syntax
new MediaElementAudioSourceNode(context, options)
Parameters
context- : An AudioContext representing the audio context you want the node to be associated with.
options- : An object defining the properties you want the
MediaElementAudioSourceNodeto have:mediaElement- : An HTMLMediaElement that will be used as the source for the audio.
- : An object defining the properties you want the
Return value
A new MediaElementAudioSourceNode object instance.
Examples
const ac = new AudioContext();
const mediaElement = document.createElement("audio");
const myAudioSource = new MediaElementAudioSourceNode(ac, {
mediaElement,
});
Specifications
Browser compatibility
来源:MDN Web Docs / Mozilla 贡献者 · 作者与贡献记录 · CC BY-SA 2.5。离线整理了版式、链接和媒体显示。
