We're looking for a user researcher to understand the needs of developers and designers. Is this you or someone you know? Check out the post: https://mzl.la/2IGzdXS

MediaElementAudioSourceNode()

The MediaElementAudioSourceNode() constructor creates a new MediaElementAudioSourceNode object instance.

Syntax

var myAudioSource = new MediaElementAudioSourceNode(context, options);

Parameters

Inherits parameters from the AudioNodeOptions dictionary.

context
An AudioContext representing the audio context you want the node to be associated with.
options
A MediaElementAudioSourceOptions dictionary object defining the properties you want the MediaElementAudioSourceNode to have:
  • mediaElement: An HTMLMediaElement that will be used as the source for the audio.

Return value

A new MediaElementAudioSourceNode object instance.

Example

var ac = new AudioContext();
var mediaElement = document.createElement('audio');

var options = {
  mediaElement : mediaElement 
}

var myAudioSource = new MediaElementAudioSourceNode(ac, options);

Specifications

Specification Status Comment
Web Audio API
The definition of 'MediaElementAudioSourceNode' in that specification.
Working Draft  

Browser compatibility

FeatureChromeEdgeFirefoxInternet ExplorerOperaSafari
Basic support551 ?53 No42 ?
FeatureAndroid webviewChrome for AndroidEdge mobileFirefox for AndroidOpera AndroidiOS SafariSamsung Internet
Basic support551551 ?5342 ?6.0

1. Before Chrome 59, the default values were not supported.

Document Tags and Contributors

Contributors to this page: fscholz, teoli, chrisdavidmills, jpmedley
Last updated by: fscholz,