Widely available Supported across all major browsers. Safe to use in production.

Browser support

Feature Desktop Mobile
Chrome
Edge
Firefox
Safari
Chrome Android
Safari iOS
14
12
25
6
18
6

The AnalyserNode() constructor of the Web Audio API creates a new AnalyserNode object instance.

55
79
53
14.1
55
14.5

The fftSize property of the AnalyserNode interface is an unsigned long value and represents the window size in samples that is used when performing a Fast Fourier Transform (FFT) to get frequency domain data.

14
12
25
6
18
6

The frequencyBinCount read-only property of the AnalyserNode interface contains the total number of data points available to AudioContext BaseAudioContext.sampleRate. This is half of the value of the AnalyserNode.fftSize. The two methods' indices have a linear relationship with the frequencies they represent, between 0 and the Nyquist frequency.

14
12
25
6
18
6

The getByteFrequencyData() method of the interface copies the current frequency data into a Uint8Array (unsigned byte array) passed into it.

14
12
25
6
18
6

The getByteTimeDomainData() method of the Interface copies the current waveform, or time-domain, data into a Uint8Array (unsigned byte array) passed into it.

14
12
25
6
18
6

The getFloatFrequencyData() method of the AnalyserNode Interface copies the current frequency data into a Float32Array array passed into it.

14
12
25
6
18
6

The getFloatTimeDomainData() method of the Interface copies the current waveform, or time-domain, data into a Float32Array array passed into it. Each array value is a sample, the magnitude of the signal at a particular time.

35
12
30
14.1
35
14.5

The maxDecibels property of the AnalyserNode interface is a double value representing the maximum power value in the scaling range for the FFT analysis data, for conversion to unsigned byte values — basically, this specifies the maximum value for the range of results when using getByteFrequencyData().

14
12
25
6
18
6

The minDecibels property of the interface is a double value representing the minimum power value in the scaling range for the FFT analysis data, for conversion to unsigned byte values — basically, this specifies the minimum value for the range of results when using getByteFrequencyData().

14
12
25
6
18
6

The smoothingTimeConstant property of the interface is a double value representing the averaging constant with the last analysis frame. It's basically an average between the current buffer and the last buffer the AnalyserNode processed, and results in a much smoother set of value changes over time.

14
12
25
6
18
6

The AudioBuffer interface represents a short audio asset residing in memory, created from an audio file using the method, or from raw data using . Once put into an AudioBuffer, the audio can then be played by being passed into an .

14
12
25
6
18
6

The AudioBuffer constructor of the Web Audio API creates a new AudioBuffer object.

55
79
53
14.1
55
14.5

The copyFromChannel() method of the AudioBuffer interface copies the audio sample data from the specified channel of the AudioBuffer to a specified Float32Array.

43
13
27
14.1
43
14.5

The copyToChannel() method of the interface copies the samples to the specified channel of the AudioBuffer, from the source array.

43
13
27
14.1
43
14.5

The duration property of the interface returns a double representing the duration, in seconds, of the PCM data stored in the buffer.

14
12
25
6
18
6

The getChannelData() method of the Interface returns a Float32Array containing the PCM data associated with the channel, defined by the channel parameter (with 0 representing the first channel).

14
12
25
6
18
6

The length property of the interface returns an integer representing the length, in sample-frames, of the PCM data stored in the buffer.

14
12
25
6
18
6

The numberOfChannels property of the interface returns an integer representing the number of discrete audio channels described by the PCM data stored in the buffer.

14
12
25
6
18
6

The sampleRate property of the AudioBuffer interface returns a float representing the sample rate, in samples per second, of the PCM data stored in the buffer.

14
12
25
6
18
6

The AudioBufferSourceNode interface is an AudioScheduledSourceNode which represents an audio source consisting of in-memory audio data, stored in an AudioBuffer.

14
12
25
6
18
6

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

55
79
53
14.1
55
14.5

The buffer property of the AudioBufferSourceNode interface provides the ability to play back audio using an AudioBuffer as the source of the sound data.

14
12
25
6
18
6

The detune property of the AudioBufferSourceNode interface is a k-rate AudioParam representing detuning of oscillation in cents.

44
13
40
14.1
44
14.5

The loop property of the interface is a Boolean indicating if the audio asset must be replayed when the end of the AudioBuffer is reached.

15
12
25
6
18
6

The loopEnd property of the interface specifies is a floating point number specifying, in seconds, at what offset into playing the AudioBuffer playback should loop back to the time indicated by the AudioBufferSourceNode.loopStart property. This is only used if the AudioBufferSourceNode.loop property is true.

24
12
25
7
25
7

The loopStart property of the AudioBufferSourceNode interface is a floating-point value indicating, in seconds, where in the AudioBuffer the restart of the play must happen.

24
12
25
7
25
7

The playbackRate property of the interface Is a k-rate AudioParam that defines the speed at which the audio asset will be played.

14
12
25
6
18
6

The start() method of the Interface is used to schedule playback of the audio data contained in the buffer, or to begin playback immediately.

24
12
25
7
25
7

The AudioContext interface represents an audio-processing graph built from audio modules linked together, each represented by an AudioNode.

35
12
25
14.1
35
14.5

The AudioContext() constructor creates a new AudioContext object which represents an audio-processing graph, built from audio modules linked together, each represented by an AudioNode.

35
12
25
14.1
35
14.5
AudioContext (options latencyHint parameter)

`options.latencyHint` parameter

58
79
14.1
58
14.5
AudioContext (options sampleRate parameter)

`options.sampleRate` parameter

74
79
61
14.1
74
14.5
AudioContext (options sinkId parameter)
Experimental

`options.sinkId` parameter

110
110
110

The baseLatency read-only property of the AudioContext interface returns a double that represents the number of seconds of processing latency incurred by the AudioContext passing an audio buffer from the AudioDestinationNode — i.e., the end of the audio graph — into the host system's audio subsystem ready for playing.

58
79
70
14.1
58
14.5

The close() method of the Interface closes the audio context, releasing any system audio resources that it uses.

42
14
40
9
42
9

The createMediaElementSource() method of the Interface is used to create a new object, given an existing HTML audio or video element, the audio from which can then be played and manipulated.

15
12
25
6
18
6

The createMediaStreamDestination() method of the Interface is used to create a new MediaStreamAudioDestinationNode object associated with a WebRTC MediaStream representing an audio stream, which may be stored in a local file or sent to another computer.

25
79
25
11
25
11

The createMediaStreamSource() method of the Interface is used to create a new object, given a media stream (say, from a instance), the audio from which can then be played and manipulated.

22
12
25
11
25
11

The createMediaStreamTrackSource() method of the AudioContext interface creates and returns a MediaStreamTrackAudioSourceNode which represents an audio source whose data comes from the specified MediaStreamTrack.

68
error_event
Experimental

`error` event

128
128
128

The getOutputTimestamp() method of the AudioContext interface returns a new AudioTimestamp object containing two audio timestamp values relating to the current audio context.

57
79
70
14.1
57
14.5

The outputLatency read-only property of the AudioContext Interface provides an estimation of the output latency of the current audio context.

102
102
70
18.4
102
18.4

The resume() method of the interface resumes the progression of time in an audio context that has previously been suspended.

41
14
40
9
41
9
setSinkId
Experimental

The setSinkId() method of the AudioContext interface sets the output audio device for the AudioContext. If a sink ID is not explicitly set, the default system audio output device will be used.

110
110
110
sinkchange_event
Experimental

The sinkchange event of the AudioContext interface is fired when the output audio device (and therefore, the AudioContext.sinkId) has changed.

110
110
110
sinkId
Experimental

The sinkId read-only property of the AudioContext interface returns the sink ID of the current output audio device.

110
110
110

The suspend() method of the Interface suspends the progression of time in the audio context, temporarily halting audio hardware access and reducing CPU/battery usage in the process — this is useful if you want an application to power down the audio hardware when it will not be using an audio context for a while.

41
14
40
9
41
9

The AudioDestinationNode interface represents the end destination of an audio graph in a given context — usually the speakers of your device. It can also be the node that will "record" the audio data when used with an OfflineAudioContext.

14
12
25
6
18
6

The maxChannelCount property of the interface is an unsigned long defining the maximum amount of channels that the physical device can handle.

27
12
25
14.1
27
14.5

The AudioNode interface is a generic interface for representing an audio processing module.

14
12
25
6
18
6

The channelCount property of the interface represents an integer used to determine how many channels are used when up-mixing and down-mixing connections to any inputs to the node.

27
12
25
7
27
7

The channelCountMode property of the interface represents an enumerated value describing the way channels must be matched between the node's inputs and outputs.

27
12
25
7
27
7

The channelInterpretation property of the AudioNode interface represents an enumerated value describing how input channels are mapped to output channels when the number of inputs/outputs is different. For example, this setting defines how a mono input will be up-mixed to a stereo or 5.1 channel output, or how a quad channel input will be down-mixed to a…

27
12
25
7
27
7

The connect() method of the interface lets you connect one of the node's outputs to a target, which may be either another AudioNode (thereby directing the sound data to the specified node) or an AudioParam, so that the node's output data is automatically used to change the value of that parameter over time.

14
12
25
6
18
6

The read-only context property of the AudioNode interface returns the associated BaseAudioContext, that is the object representing the processing graph the node is participating in.

14
12
25
6
18
6

The disconnect() method of the interface lets you disconnect one or more nodes from the node on which the method is called.

14
12
25
6
18
6
disconnect (destination parameter)

`destination` parameter

43
≤18
43
disconnect (input parameter)

`input` parameter

43
≤18
43

The numberOfInputs property of the AudioNode interface returns the number of inputs feeding the node. Source nodes are defined as nodes having a numberOfInputs property with a value of 0.

14
12
25
6
18
6

The numberOfOutputs property of the interface returns the number of outputs coming out of the node. Destination nodes — like — have a value of 0 for this attribute.

14
12
25
6
18
6

The Web Audio API's AudioParam interface represents an audio-related parameter, usually a parameter of an AudioNode (such as ).

14
12
25
6
18
6
automationRate
68
79
14
68
14

The cancelAndHoldAtTime() method of the AudioParam interface cancels all scheduled future changes to the AudioParam but holds its value at a given time until further changes are made using other methods.

57
79
14.1
57
14.5

The cancelScheduledValues() method of the Interface cancels all scheduled future changes to the AudioParam.

83
83
25
14.1
83
14.5

The defaultValue read-only property of the interface represents the initial value of the attributes as defined by the specific AudioNode creating the AudioParam.

14
12
25
6
18
6

The exponentialRampToValueAtTime() method of the AudioParam Interface schedules a gradual exponential change in the value of the AudioParam. The change starts at the time specified for the previous event, follows an exponential ramp to the new value given in the value parameter, and reaches the new value at the time given in the endTime parameter.

14
12
25
6
18
6

The linearRampToValueAtTime() method of the Interface schedules a gradual linear change in the value of the AudioParam. The change starts at the time specified for the previous event, follows a linear ramp to the new value given in the value parameter, and reaches the new value at the time given in the endTime parameter.

14
12
25
6
18
6

The maxValue read-only property of the AudioParam interface represents the maximum possible value for the parameter's nominal (effective) range.

52
79
53
6
52
6

The minValue read-only property of the AudioParam interface represents the minimum possible value for the parameter's nominal (effective) range.

52
79
53
6
52
6

The setTargetAtTime() method of the AudioParam interface schedules the start of a gradual change to the AudioParam value. This is useful for decay or release portions of ADSR envelopes.

24
12
25
6
25
6

The setValueAtTime() method of the AudioParam interface schedules an instant change to the AudioParam value at a precise time, as measured against BaseAudioContext/currentTime. The new value is given in the value parameter.

14
12
25
6
18
6

The setValueCurveAtTime() method of the AudioParam interface schedules the parameter's value to change following a curve defined by a list of values.

14
12
25
6
18
6

The value property of the AudioParam interface gets or sets the value of this AudioParam at the current time. Initially, the value is set to AudioParam.defaultValue.

14
12
25
6
18
6

The AudioParamMap interface of the Web Audio API represents an iterable and read-only set of multiple audio parameters.

66
79
76
14.1
66
14.5
@@iterator

[Symbol.iterator]

66
79
76
14.1
66
14.5
entries
66
79
76
14.1
66
14.5
forEach
66
79
76
14.1
66
14.5
get
66
79
76
14.1
66
14.5
has
66
79
76
14.1
66
14.5
keys
66
79
76
14.1
66
14.5
size
66
79
76
14.1
66
14.5
values
66
79
76
14.1
66
14.5

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 AudioScheduledSourceNode.start and AudioScheduledSourceNode.stop methods, as well as the…

57
79
53
14
57
14

The ended event of the AudioScheduledSourceNode interface is fired when the source node has stopped playing.

30
12
25
7
30
7

The start() method on AudioScheduledSourceNode schedules a sound to begin playback at the specified time. If no time is specified, then the sound begins playing immediately.

24
12
25
7
25
7

The stop() method on AudioScheduledSourceNode schedules a sound to cease playback at the specified time. If no time is specified, then the sound stops playing immediately.

24
12
25
7
25
7
AudioSinkInfo
Experimental

The AudioSinkInfo interface of the Web Audio API represents information describing an AudioContext's sink ID, retrieved via AudioContext.sinkId.

110
110
110
type
Experimental

The type read-only property of the AudioSinkInfo interface returns the type of the audio output device.

110
110
110

The BaseAudioContext interface of the Web Audio API acts as a base definition for online and offline audio-processing graphs, as represented by AudioContext and OfflineAudioContext respectively. You wouldn't use BaseAudioContext directly — you'd use its features via one of these two inheriting interfaces.

56
79
53
14.1
56
14.5

The createAnalyser() method of the BaseAudioContext interface creates an AnalyserNode, which can be used to expose audio time and frequency data and create data visualizations.

14
12
25
6
18
6

The createBiquadFilter() method of the interface creates a , which represents a second order filter configurable as several different common filter types.

14
12
25
6
18
6

The createBuffer() method of the Interface is used to create a new, empty object, which can then be populated by data, and played via an .

14
12
25
6
18
6

The createBufferSource() method of the Interface is used to create a new , which can be used to play audio data contained within an object. AudioBuffers are created using BaseAudioContext.createBuffer or returned by BaseAudioContext.decodeAudioData when it successfully decodes an audio track.

14
12
25
6
18
6

The createChannelMerger() method of the BaseAudioContext interface creates a ChannelMergerNode, which combines channels from multiple audio streams into a single audio stream.

14
12
25
6
18
6

The createChannelSplitter() method of the BaseAudioContext Interface is used to create a ChannelSplitterNode, which is used to access the individual channels of an audio stream and process them separately.

14
12
25
6
18
6

The createConstantSource() property of the BaseAudioContext interface creates a ConstantSourceNode object, which is an audio source that continuously outputs a monaural (one-channel) sound signal whose samples all have the same value.

56
79
52
14.1
56
14.5

The createConvolver() method of the interface creates a , which is commonly used to apply reverb effects to your audio. See the spec definition of Convolution for more information.

14
12
25
6
18
6

The createDelay() method of the BaseAudioContext Interface is used to create a DelayNode, which is used to delay the incoming audio signal by a certain amount of time.

24
12
25
7
25
7

The createDynamicsCompressor() method of the BaseAudioContext Interface is used to create a DynamicsCompressorNode, which can be used to apply compression to an audio signal.

14
12
25
6
18
6

The createGain() method of the interface creates a , which can be used to control the overall gain (or volume) of the audio graph.

24
12
25
7
25
7

The createIIRFilter() method of the BaseAudioContext interface creates an , which represents a general infinite impulse response (IIR) filter which can be configured to serve as various types of filter.

49
14
50
14.1
49
14.5

The createOscillator() method of the BaseAudioContext interface creates an OscillatorNode, a source representing a periodic waveform. It basically generates a constant tone.

20
12
25
6
25
6

The createPanner() method of the Interface is used to create a new PannerNode, which is used to spatialize an incoming audio stream in 3D space.

14
12
25
6
18
6

The createPeriodicWave() method of the interface is used to create a PeriodicWave. This wave is used to define a periodic waveform that can be used to shape the output of an .

30
12
25
8
30
8
createPeriodicWave (constraints disableNormalization parameter)

`constraints.disableNormalization` parameter

46
12
49
14.1
46
14.5

The createStereoPanner() method of the interface creates a , which can be used to apply stereo panning to an audio source. It positions an incoming audio stream in a stereo image using a low-cost panning algorithm.

41
12
37
14.1
41
14.5

The createWaveShaper() method of the interface creates a , which represents a non-linear distortion. It is used to apply distortion effects to your audio.

15
12
25
6
18
6

The currentTime read-only property of the interface returns a double representing an ever-increasing hardware timestamp in seconds that can be used for scheduling audio playback, visualizing timelines, etc. It starts at 0.

14
12
25
6
18
6

The decodeAudioData() method of the Interface is used to asynchronously decode audio file data contained in an ArrayBuffer that is loaded from Window/fetch, XMLHttpRequest, or FileReader. The decoded AudioBuffer is resampled to the AudioContext's sampling rate, then passed to a callback or promise.

14
12
25
6
18
6
decodeAudioData (returns promise)

Returns a `Promise`

49
12
36
14.1
49
14.5

The destination property of the interface returns an representing the final destination of all audio in the context. It often represents an actual audio-rendering device such as your device's speakers.

14
12
25
6
18
6

The listener property of the interface returns an object that can then be used for implementing 3D audio spatialization.

14
12
25
6
18
6

The sampleRate property of the BaseAudioContext interface returns a floating point number representing the sample rate, in samples per second, used by all nodes in this audio context. This limitation means that sample-rate converters are not supported.

14
12
25
6
18
6

The state read-only property of the interface returns the current state of the AudioContext.

41
14
40
9
41
9

A statechange event is fired at a BaseAudioContext object when its BaseAudioContext.state member changes.

41
14
40
9
41
9

The BiquadFilterNode interface represents a simple low-order filter, and is created using the method. It is an AudioNode that can represent different kinds of filters, tone control devices, and graphic equalizers. A BiquadFilterNode always has exactly one input and one output.

14
12
25
6
18
6

The BiquadFilterNode() constructor of the Web Audio API creates a new BiquadFilterNode object, which represents a simple low-order filter.

55
79
53
14.1
55
14.5

The detune property of the interface is an a-rate AudioParam representing detuning of the frequency in cents.

25
12
25
7
25
7

The frequency property of the interface is an a-rate AudioParam — a double representing a frequency in the current filtering algorithm measured in hertz (Hz).

14
12
25
6
18
6

The gain property of the interface is an a-rate AudioParam — a double representing the gain used in the current filtering algorithm.

14
12
25
6
18
6

The getFrequencyResponse() method of the interface takes the current filtering algorithm's settings and calculates the frequency response for frequencies specified in a specified array of frequencies.

17
12
25
6
18
6

The Q property of the interface is an a-rate AudioParam, a double representing a Q factor, or quality factor.

14
12
25
6
18
6

The type property of the interface is a string (enum) value defining the kind of filtering algorithm the node is implementing.

14
12
25
6
18
6

The ChannelMergerNode interface, often used in conjunction with its opposite, ChannelSplitterNode, reunites different mono inputs into a single output. Each input is used to fill a channel of the output. This is useful for accessing each channel separately, e.g., for performing channel mixing where gain must be separately controlled on each channel.

14
12
25
6
18
6

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

55
79
53
14.1
55
14.5

The ChannelSplitterNode interface, often used in conjunction with its opposite, ChannelMergerNode, separates the different channels of an audio source into a set of mono outputs. This is useful for accessing each channel separately, e.g., for performing channel mixing where gain must be separately controlled on each channel.

14
12
25
6
18
6

The ChannelSplitterNode() constructor of the Web Audio API creates a new ChannelSplitterNode object instance, representing a node that splits the input into a separate output for each of the source node's audio channels.

55
79
53
14.1
55
14.5

The ConstantSourceNode interface—part of the Web Audio API—represents an audio source (based upon AudioScheduledSourceNode) whose output is single unchanging value. This makes it useful for cases in which you need a constant value coming in from an audio source. In addition, it can be used like a constructible AudioParam by automating the value of its…

56
79
52
14.1
56
14.5

The ConstantSourceNode() constructor creates a new ConstantSourceNode object instance, representing an audio source which constantly outputs samples whose values are always the same.

56
79
52
14.1
56
14.5

The read-only offset property of the interface returns an AudioParam object indicating the numeric a-rate value which is always returned by the source when asked for the next sample.

56
79
52
14.1
56
14.5

The ConvolverNode interface is an AudioNode that performs a Linear Convolution on a given AudioBuffer, often used to achieve a reverb effect. A ConvolverNode always has exactly one input and one output.

14
12
25
6
18
6

The buffer property of the interface represents a mono, stereo, or 4-channel AudioBuffer containing the (possibly multichannel) impulse response used by the ConvolverNode to create the reverb effect.

14
12
25
6
18
6

The ConvolverNode() constructor of the Web Audio API creates a new ConvolverNode object instance.

55
79
53
14.1
55
14.5

The normalize property of the interface is a boolean that controls whether the impulse response from the buffer will be scaled by an equal-power normalization when the buffer attribute is set, or not.

18
12
25
6
18
6

The DelayNode interface represents a delay-line; an AudioNode audio-processing module that causes a delay between the arrival of an input data and its propagation to the output.

24
12
25
7
25
7

The DelayNode() constructor of the Web Audio API creates a new DelayNode object with a delay-line; an AudioNode audio-processing module that causes a delay between the arrival of an input data, and its propagation to the output.

55
79
53
14.1
55
14.5

The delayTime property of the interface is an a-rate AudioParam representing the amount of delay to apply.

24
12
25
7
25
7

The DynamicsCompressorNode interface provides a compression effect, which lowers the volume of the loudest parts of a signal. Compression can help prevent clipping and distortion when multiple sounds are combined, and it is also used in music production and game audio for dynamic control, tone shaping, and creative effects. DynamicsCompressorNode is an…

14
12
25
6
18
6

The attack property of the interface is a k-rate AudioParam representing the amount of time, in seconds, required to reduce the gain by 10 dB. It defines how quickly the signal is adapted when its volume is increased.

19
12
25
6
25
6

The DynamicsCompressorNode() constructor creates a new DynamicsCompressorNode object instance, which can be used to provide a compression effect that lowers the volume of the loudest parts of a signal.

55
79
53
14.1
55
14.5

The knee property of the interface is a k-rate AudioParam containing a decibel value representing the range above the threshold where the curve smoothly transitions to the compressed portion.

19
12
25
6
25
6

The ratio property of the interface Is a k-rate AudioParam representing the amount of change, in dB, needed in the input for a 1 dB change in the output.

19
12
25
6
25
6

The reduction read-only property of the interface is a float representing the amount of gain reduction currently applied by the compressor to the signal.

19
12
25
6
25
6

The release property of the interface Is a k-rate AudioParam representing the amount of time, in seconds, required to increase the gain by 10 dB. It defines how quick the signal is adapted when its volume is reduced.

20
12
25
6
25
6

The threshold property of the interface is a k-rate AudioParam representing the decibel value above which the compression will start taking effect.

19
12
25
6
25
6

The GainNode interface represents a change in volume. It is an AudioNode audio-processing module that causes a given gain to be applied to the input data before its propagation to the output. A GainNode always has exactly one input and one output, both with the same number of channels.

24
12
25
7
25
7

The gain property of the interface is an a-rate AudioParam representing the amount of gain to apply.

24
12
25
7
25
7

The GainNode() constructor of the Web Audio API creates a new GainNode object which is an AudioNode that represents a change in volume.

55
79
53
14.1
55
14.5

The IIRFilterNode interface of the Web Audio API is an AudioNode processor which implements a general infinite impulse response (IIR) filter; this type of filter can be used to implement tone control devices and graphic equalizers as well. It lets the parameters of the filter response be specified, so that it can be tuned as needed.

49
14
50
14.1
49
14.5

The getFrequencyResponse() method of the interface takes the current filtering algorithm's settings and calculates the frequency response for frequencies specified in a specified array of frequencies.

49
14
50
14.1
49
14.5

The IIRFilterNode() constructor of the Web Audio API creates a new IIRFilterNode object which an AudioNode processor which implements a general infinite impulse response filter.

55
79
53
14.1
55
14.5

The MediaElementAudioSourceNode interface represents an audio source consisting of an HTML or element. It is an AudioNode that acts as an audio source.

15
12
25
6
18
6

The MediaElementAudioSourceNode interface's read-only mediaElement property indicates the HTMLMediaElement that contains the audio track from which the node is receiving audio.

15
79
70
6
18
6

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

55
79
53
14.1
55
14.5

The MediaStreamAudioDestinationNode interface represents an audio destination consisting of a WebRTC MediaStream with a single AudioMediaStreamTrack, which can be used in a similar way to a MediaStream obtained from MediaDevices.getUserMedia.

25
18
25
11
25
11

The MediaStreamAudioDestinationNode() constructor of the Web Audio API creates a new MediaStreamAudioDestinationNode object instance.

57
79
53
14.1
57
14.5

The stream property of the interface represents a MediaStream containing a single audio MediaStreamTrack with the same number of channels as the node itself.

25
18
25
11
25
11

The 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.

22
12
25
11
25
11

The MediaStreamAudioSourceNode interface's read-only mediaStream property indicates the MediaStream that contains the audio track from which the node is receiving audio.

22
79
70
11
25
11

The Web Audio API's MediaStreamAudioSourceNode() constructor creates and returns a new MediaStreamAudioSourceNode object which uses the first audio track of a given MediaStream as its source.

55
79
53
14.1
55
14.5

The MediaStreamTrackAudioSourceNode interface is a type of AudioNode which represents a source of audio data taken from a specific MediaStreamTrack obtained through the WebRTC or Media Capture and Streams APIs.

68

The Web Audio API's MediaStreamTrackAudioSourceNode() constructor creates and returns a new MediaStreamTrackAudioSourceNode object whose audio is taken from the MediaStreamTrack specified in the given options object.

68

The OscillatorNode interface represents a periodic waveform, such as a sine wave. It is an AudioScheduledSourceNode audio-processing module that causes a specified frequency of a given wave to be created—in effect, a constant tone.

20
12
25
6
25
6

The detune property of the interface is an a-rate AudioParam representing detuning of oscillation in cents.

20
12
25
6
25
6

The frequency property of the interface is an a-rate AudioParam representing the frequency of oscillation in hertz.

20
12
25
6
25
6

The OscillatorNode() constructor of the Web Audio API creates a new OscillatorNode object which is an AudioNode that represents a periodic waveform, like a sine wave, optionally setting the node's properties' values to match values in a specified object.

55
79
53
14.1
55
14.5

The setPeriodicWave() method of the OscillatorNode interface is used to point to a PeriodicWave defining a periodic waveform that can be used to shape the oscillator's output, when OscillatorNode.type is custom.

30
12
25
8
30
8

The type property of the OscillatorNode interface specifies what shape of waveform the oscillator will output. There are several common waveforms available, as well as an option to specify a custom waveform shape. The shape of the waveform will affect the tone that is produced.

20
12
25
6
25
6

The PannerNode interface defines an audio-processing object that represents the location, direction, and behavior of an audio source signal in a simulated physical space. This AudioNode uses right-hand Cartesian coordinates to describe the source's position as a vector and its orientation as a 3D directional cone.

14
12
25
6
18
6

The coneInnerAngle property of the interface is a double value describing the angle, in degrees, of a cone inside of which there will be no volume reduction.

14
12
25
6
18
6

The coneOuterAngle property of the interface is a double value describing the angle, in degrees, of a cone outside of which the volume will be reduced by a constant value, defined by the PannerNode.coneOuterGain property.

14
12
25
6
18
6

The coneOuterGain property of the interface is a double value, describing the amount of volume reduction outside the cone, defined by the PannerNode.coneOuterAngle attribute.

14
12
25
6
18
6

The distanceModel property of the interface is an enumerated value determining which algorithm to use to reduce the volume of the audio source as it moves away from the listener.

14
12
25
6
18
6

The maxDistance property of the interface is a double value representing the maximum distance between the audio source and the listener, after which the volume is not reduced any further. This value is used only by the linear distance model.

14
12
25
6
18
6

The orientationX property of the PannerNode interface indicates the X (horizontal) component of the direction in which the audio source is facing, in a 3D Cartesian coordinate space.

52
79
50
14.1
52
14.5

The orientationY property of the interface indicates the Y (vertical) component of the direction the audio source is facing, in 3D Cartesian coordinate space.

52
79
50
14.1
52
14.5

The orientationZ property of the interface indicates the Z (depth) component of the direction the audio source is facing, in 3D Cartesian coordinate space.

52
79
50
14.1
52
14.5

The PannerNode() constructor of the Web Audio API creates a new PannerNode object instance.

55
79
53
14.1
55
14.5

The panningModel property of the interface is an enumerated value determining which spatialization algorithm to use to position the audio in 3D space.

14
12
25
6
18
6

The positionX property of the interface specifies the X coordinate of the audio source's position in 3D Cartesian coordinates, corresponding to the horizontal axis (left-right).

52
79
50
14.1
52
14.5

The positionY property of the interface specifies the Y coordinate of the audio source's position in 3D Cartesian coordinates, corresponding to the vertical axis (top-bottom). The complete vector is defined by the position of the audio source, given as (PannerNode.positionX, positionY, PannerNode.positionZ), and the orientation of the audio source (that is,…

52
79
50
14.1
52
14.5

The positionZ property of the interface specifies the Z coordinate of the audio source's position in 3D Cartesian coordinates, corresponding to the depth axis (behind-in front of the listener). The complete vector is defined by the position of the audio source, given as (PannerNode.positionX, PannerNode.positionY, positionZ), and the orientation of the…

52
79
50
14.1
52
14.5

The refDistance property of the interface is a double value representing the reference distance for reducing volume as the audio source moves further from the listener – i.e., the distance at which the volume reduction starts taking effect. This value is used by all distance models.

14
12
25
6
18
6

The rolloffFactor property of the interface is a double value describing how quickly the volume is reduced as the source moves away from the listener. This value is used by all distance models. The rolloffFactor property's default value is 1.

14
12
25
6
18
6

The PeriodicWave interface defines a periodic waveform that can be used to shape the output of an OscillatorNode.

30
12
25
8
30
8

The PeriodicWave() constructor of the Web Audio API creates a new PeriodicWave object instance.

55
79
53
14.1
55
14.5

The StereoPannerNode interface of the Web Audio API represents a simple stereo panner node that can be used to pan an audio stream left or right. It is an AudioNode audio-processing module that positions an incoming audio stream in a stereo image using a low-cost equal-power panning algorithm.

41
12
37
14.1
41
14.5

The pan property of the interface is an a-rate AudioParam representing the amount of panning to apply. The value can range between -1 (full left pan) and 1 (full right pan).

41
12
37
14.1
41
14.5

The StereoPannerNode() constructor of the Web Audio API creates a new StereoPannerNode object which is an AudioNode that represents a simple stereo panner node that can be used to pan an audio stream left or right.

55
79
53
14.1
55
14.5

The WaveShaperNode interface represents a non-linear distorter.

15
12
25
6
18
6

The curve property of the interface is a Float32Array of numbers describing the distortion to apply.

15
12
25
6
18
6

The oversample property of the interface is an enumerated value indicating if oversampling must be used. Oversampling is a technique for creating more samples (up-sampling) before applying a distortion effect to the audio signal.

29
12
26
6
29
6

The WaveShaperNode() constructor of the Web Audio API creates a new WaveShaperNode object which is an AudioNode that represents a non-linear distorter.

55
79
53
14.1
55
14.5
1+Supported (version) Not supported Has note Sub-feature descriptions sourced from MDN Web Docs (CC BY-SA 2.5)
Notes 1 item(s)
Removed
  • The `context` parameter was supported up until version 57, but has now been removed.
Notes 1 item(s)
Removed
  • The `context` parameter was supported up until version 57, but has now been removed.
Notes 1 item(s)
Implementation note
  • Firefox currently handles the value `null` incorrectly. Instead of producing a node that generates a single channel of silence, the node becomes unusable and will be ignored if you attempt to connect it to anything.
Notes 2 item(s)
Removed
  • This feature was removed in a later browser version (57)
Compatibility
  • Available with a vendor prefix: webkit (14)
Notes 2 item(s)
Removed
  • This feature was removed in a later browser version (14.1)
Compatibility
  • Available with a vendor prefix: webkit (6)
Notes 2 item(s)
Removed
  • This feature was removed in a later browser version (57)
Compatibility
  • Available with a vendor prefix: webkit (18)
Notes 2 item(s)
Removed
  • This feature was removed in a later browser version (14.5)
Compatibility
  • Available with a vendor prefix: webkit (6)
Notes 4 item(s)
Implementation note
  • Before Chrome 66, each tab is limited to 6 audio contexts in Chrome; attempting to create more will throw a `DOMException`. For details see Per-tab audio context limitation in Chrome.
  • If `latencyHint` isn't valid, Chrome throws a `TypeError` exception. See Non-standard exceptions in Chrome for details.
Removed
  • This feature was removed in a later browser version (57)
Compatibility
  • Available with a vendor prefix: webkit (14)
Notes 2 item(s)
Implementation note
  • New audio contexts are suspended until the `resume()` method is called via user action, such as the `click` event.
Compatibility
  • Available with a vendor prefix: webkit (6)
Notes 4 item(s)
Implementation note
  • Before Chrome Android 66, each tab is limited to 6 audio contexts in Chrome Android; attempting to create more will throw a `DOMException`. For details see Per-tab audio context limitation in Chrome Android.
  • If `latencyHint` isn't valid, Chrome Android throws a `TypeError` exception. See Non-standard exceptions in Chrome Android for details.
Removed
  • This feature was removed in a later browser version (57)
Compatibility
  • Available with a vendor prefix: webkit (18)
Notes 2 item(s)
Implementation note
  • New audio contexts are suspended until the `resume()` method is called via user action, such as the `click` event.
Compatibility
  • Available with a vendor prefix: webkit (6)
Notes 1 item(s)
Implementation note
  • If a sample rate is specified for the audio context, it must match the sample rate of the stream, otherwise this method will fail.
Notes 1 item(s)
Implementation note
  • Firefox 68 implements the updated standard's definition of the "first" audio track; now the first track is the one whose ID comes first lexicographically.
Notes 3 item(s)
Limitation
  • This browser only partially implements this feature
Removed
  • This feature was removed in a later browser version (14.1)
Implementation note
  • This property always returns `0`.
Notes 3 item(s)
Limitation
  • This browser only partially implements this feature
Removed
  • This feature was removed in a later browser version (14.5)
Implementation note
  • This property always returns `0`.
Notes 3 item(s)
Limitation
  • This browser only partially implements this feature
Removed
  • This feature was removed in a later browser version (83)
Implementation note
  • Before Chrome 83, `cancelScheduledValues()` does not cancel in-progress curve events created by `setValueCurveAtTime()`. See bug 40123334.
Notes 3 item(s)
Limitation
  • This browser only partially implements this feature
Removed
  • This feature was removed in a later browser version (83)
Implementation note
  • Before Edge 83, `cancelScheduledValues()` does not cancel in-progress curve events created by `setValueCurveAtTime()`.
Notes 2 item(s)
Limitation
  • This browser only partially implements this feature
Implementation note
  • Does not cancel in-progress curve events created by `setValueCurveAtTime()`. See bug 1752775.
Notes 3 item(s)
Limitation
  • This browser only partially implements this feature
Removed
  • This feature was removed in a later browser version (14.1)
Implementation note
  • Before Safari 14.1, `cancelScheduledValues()` does not cancel in-progress curve events created by `setValueCurveAtTime()`. See bug 216132.
Notes 3 item(s)
Limitation
  • This browser only partially implements this feature
Removed
  • This feature was removed in a later browser version (83)
Implementation note
  • Before Chrome Android 83, `cancelScheduledValues()` does not cancel in-progress curve events created by `setValueCurveAtTime()`. See bug 40123334.
Notes 3 item(s)
Limitation
  • This browser only partially implements this feature
Removed
  • This feature was removed in a later browser version (14.5)
Implementation note
  • Before Safari on iOS 14.1, `cancelScheduledValues()` does not cancel in-progress curve events created by `setValueCurveAtTime()`. See bug 216132.
Notes 2 item(s)
Limitation
  • This browser only partially implements this feature
Implementation note
  • Sometimes jumps to value immediately. See bug 2011524.
Notes 2 item(s)
Limitation
  • This browser only partially implements this feature
Implementation note
  • Behaves like `setValueAtTime()`: Sets the target volume at the specified time, but doesn't ramp to it.
Notes 2 item(s)
Limitation
  • This browser only partially implements this feature
Implementation note
  • Sometimes jumps to value immediately. See bug 2011524.
Notes 2 item(s)
Limitation
  • This browser only partially implements this feature
Implementation note
  • Behaves like `setValueAtTime()`: Sets the target volume at the specified time, but doesn't ramp to it.
Notes 2 item(s)
Removed
  • This feature was removed in a later browser version (24)
Implementation note
  • Previously available under a different name: setTargetValueAtTime (14)
Notes 2 item(s)
Removed
  • This feature was removed in a later browser version (25)
Implementation note
  • Previously available under a different name: setTargetValueAtTime (18)
Notes 1 item(s)
Implementation note
  • Before version 66, the gain value of a `GainNode` would perform a smooth interpolation to prevent dezippering (instead of changing instantly).
Notes 2 item(s)
Implementation note
  • Before Firefox 134, setting `value` was ignored when done at the same time as scheduled automation events.
  • Before Firefox 69, `value` did not take into account scheduled or gradiated changes to the parameter's value; instead, only explicitly set values were returned.
Notes 1 item(s)
Implementation note
  • Before version 66, the gain value of a `GainNode` would perform a smooth interpolation to prevent dezippering (instead of changing instantly).
Notes 3 item(s)
Limitation
  • This browser only partially implements this feature
Removed
  • This feature was removed in a later browser version (57)
Implementation note
  • The `AudioScheduledSourceNode` interface itself is not present, but some of its members are available on the `AudioBufferSourceNode`, `ConstantSourceNode` and `OscillatorNode` interfaces.
Notes 3 item(s)
Limitation
  • This browser only partially implements this feature
Removed
  • This feature was removed in a later browser version (79)
Implementation note
  • The `AudioScheduledSourceNode` interface itself is not present, but some of its members are available on the `AudioBufferSourceNode`, `ConstantSourceNode` and `OscillatorNode` interfaces.
Notes 3 item(s)
Limitation
  • This browser only partially implements this feature
Removed
  • This feature was removed in a later browser version (53)
Implementation note
  • The `AudioScheduledSourceNode` interface itself is not present, but some of its members are available on the `AudioBufferSourceNode`, `ConstantSourceNode` and `OscillatorNode` interfaces.
Notes 3 item(s)
Limitation
  • This browser only partially implements this feature
Removed
  • This feature was removed in a later browser version (14)
Implementation note
  • The `AudioScheduledSourceNode` interface itself is not present, but some of its members are available on the `AudioBufferSourceNode`, `ConstantSourceNode` and `OscillatorNode` interfaces.
Notes 3 item(s)
Limitation
  • This browser only partially implements this feature
Removed
  • This feature was removed in a later browser version (57)
Implementation note
  • The `AudioScheduledSourceNode` interface itself is not present, but some of its members are available on the `AudioBufferSourceNode`, `ConstantSourceNode` and `OscillatorNode` interfaces.
Notes 3 item(s)
Limitation
  • This browser only partially implements this feature
Removed
  • This feature was removed in a later browser version (14)
Implementation note
  • The `AudioScheduledSourceNode` interface itself is not present, but some of its members are available on the `AudioBufferSourceNode`, `ConstantSourceNode` and `OscillatorNode` interfaces.
Notes 3 item(s)
Limitation
  • This browser only partially implements this feature
Removed
  • This feature was removed in a later browser version (56)
Implementation note
  • The `BaseAudioContext` interface itself is not present, but many of the methods are available on the `AudioContext` and `OfflineAudioContext` interfaces.
Notes 3 item(s)
Limitation
  • This browser only partially implements this feature
Removed
  • This feature was removed in a later browser version (79)
Implementation note
  • The `BaseAudioContext` interface itself is not present, but many of the methods are available on the `AudioContext` and `OfflineAudioContext` interfaces.
Notes 3 item(s)
Limitation
  • This browser only partially implements this feature
Removed
  • This feature was removed in a later browser version (53)
Implementation note
  • The `BaseAudioContext` interface itself is not present, but many of the methods are available on the `AudioContext` and `OfflineAudioContext` interfaces.
Notes 3 item(s)
Limitation
  • This browser only partially implements this feature
Removed
  • This feature was removed in a later browser version (14.1)
Implementation note
  • The `BaseAudioContext` interface itself is not present, but many of the methods are available on the `AudioContext` and `OfflineAudioContext` interfaces.
Notes 3 item(s)
Limitation
  • This browser only partially implements this feature
Removed
  • This feature was removed in a later browser version (56)
Implementation note
  • The `BaseAudioContext` interface itself is not present, but many of the methods are available on the `AudioContext` and `OfflineAudioContext` interfaces.
Notes 3 item(s)
Limitation
  • This browser only partially implements this feature
Removed
  • This feature was removed in a later browser version (14.5)
Implementation note
  • The `BaseAudioContext` interface itself is not present, but many of the methods are available on the `AudioContext` and `OfflineAudioContext` interfaces.
Notes 1 item(s)
Implementation note
  • Starting in Chrome 56, `channelCountMode` is set to `explicit` and `channelCount` is fixed to the number of outputs, as per the latest spec.
Notes 1 item(s)
Implementation note
  • Starting in Chrome Android 56, `channelCountMode` is set to `explicit` and `channelCount` is fixed to the number of outputs, as per the latest spec.
Notes 1 item(s)
Implementation note
  • Before version 52, this was an `AudioParam.`.
Notes 1 item(s)
Implementation note
  • Before version 52, this was an `AudioParam.`.
Notes 1 item(s)
Implementation note
  • Firefox 68 implements the updated standard's definition of the "first" audio track; now the first track is the one whose ID comes first lexicographically.

Use cases

  • Using Web Audio

    The AnalyserNode interface represents a node able to provide real-time frequency and time-domain analysis information.

Cautions

  • May not be supported in older browsers.

Implementation notes

  • Some APIs require a secure context (HTTPS) or user activation. Check the requirements before use.