Please note, this is a STATIC archive of website developer.mozilla.org from 03 Nov 2016, cach3.com does not collect or store any user information, there is no "phishing" involved.

Revision 965269 of Web Audio API

  • Revision slug: Web/API/Web_Audio_API
  • Revision title: Web Audio API
  • Revision id: 965269
  • Created:
  • Creator: ScottMichaud
  • Is current revision? No
  • Comment

Revision Content

The Web Audio API provides a powerful and versatile system for controlling audio on the Web, allowing developers to choose audio sources, add effects to audio, create audio visualizations, apply spatial effects (such as panning)  and much more.

Web audio concepts and usage

The Web Audio API involves handling audio operations inside an audio context, and has been designed to allow modular routing. Basic audio operations are performed with audio nodes, which are linked together to form an audio routing graph. Several sources — with different types of channel layout — are supported even within a single context. This modular design provides the flexibility to create complex audio functions with dynamic effects.

Audio nodes are linked into chains and simple webs by their inputs and outputs. They typically start with one or more sources. Sources provide arrays of sound intensities (samples) at very small timeslices, often tens of thousands of them per second. These could be either computed mathematically (see: OscillatorNode), or they can be recordings from sound/video files (see: AudioBufferSourceNode and MediaElementAudioSourceNode) and audio streams (see: MediaStreamAudioSourceNode). In fact, sound files are just recordings of sound intensities themselves, which come in from microphones or electric instruments, and get mixed down into a single, complicated wave. Outputs of these nodes could be linked to inputs of others, which mix or modify these streams of sound samples into different streams. A common modification is multiplying the samples by a value to make them louder or quieter (see: GainNode). Once the sound has been sufficiently processed for the intended effect, it can be linked to the input of a destination (see: AudioContext.destination) that sends it to the speakers or headphones. This last connection is only necessary if the user is supposed to hear the audio.

A simple, typical workflow for web audio would look something like this:

  1. Create audio context
  2. Inside the context, create sources — such as <audio>, oscillator, stream
  3. Create effects nodes, such as reverb, biquad filter, panner, compressor
  4. Choose final destination of audio, for example your system speakers
  5. Connect the sources up to the effects, and the effects to the destination.

A simple box diagram with an outer box labeled Audio context, and three inner boxes labeled Sources, Effects and Destination. The three inner boxes have arrow between them pointing from left to right, indicating the flow of audio information.

Timing is controlled with high precision and low latency, allowing developers to write code that responds accurately to events and is able to target specific samples, even at a high sample rate. So applications such as drum machines and sequencers are well within reach.

The Web Audio API also allows us to control how audio is spatialized. Using a system based on a source-listener model, it allows control of the panning model and deals with distance-induced attenuation or doppler shift induced by a moving source (or moving listener).

Note: You can read about the theory of the Web Audio API in a lot more detail in our article Basic concepts behind Web Audio API.

Web Audio API Interfaces

The Web Audio API has a total of 28 interfaces and associated events, which we have split up into nine categories of functionality.

General audio graph definition

General containers and definitions that shape audio graphs in Web Audio API usage.

{{domxref("AudioContext")}}
The AudioContext interface represents an audio-processing graph built from audio modules linked together, each represented by an {{domxref("AudioNode")}}. An audio context controls the creation of the nodes it contains and the execution of the audio processing, or decoding. You need to create an AudioContext before you do anything else, as everything happens inside a context.
{{domxref("AudioNode")}}
The AudioNode interface represents an audio-processing module like an audio source (e.g. an HTML {{HTMLElement("audio")}} or {{HTMLElement("video")}} element), audio destination, intermediate processing module (e.g. a filter like {{domxref("BiquadFilterNode")}}, or volume control like {{domxref("GainNode")}}).
{{domxref("AudioParam")}}
The AudioParam interface represents an audio-related parameter, like one of an {{domxref("AudioNode")}}. It can be set to a specific value or a change in value, and can be scheduled to happen at a specific time and following a specific pattern.
{{event("ended_(Web_Audio)", "ended")}} (event)
The ended event is fired when playback has stopped because the end of the media was reached.

Defining audio sources

Interfaces that define audio sources for use in the Web Audio API.

{{domxref("OscillatorNode")}}
The OscillatorNode interface represents a sine wave. It is an {{domxref("AudioNode")}} audio-processing module that causes a given frequency of sine wave to be created.
{{domxref("AudioBuffer")}}
The AudioBuffer interface represents a short audio asset residing in memory, created from an audio file using the {{ domxref("AudioContext.decodeAudioData()") }} method, or created with raw data using {{ domxref("AudioContext.createBuffer()") }}. Once decoded into this form, the audio can then be put into an {{ domxref("AudioBufferSourceNode") }}.
{{domxref("AudioBufferSourceNode")}}
The AudioBufferSourceNode interface represents an audio source consisting of in-memory audio data, stored in an {{domxref("AudioBuffer")}}. It is an {{domxref("AudioNode")}} that acts as an audio source.
{{domxref("MediaElementAudioSourceNode")}}
The MediaElementAudioSourceNode interface represents an audio source consisting of an HTML5 {{ htmlelement("audio") }} or {{ htmlelement("video") }} element. It is an {{domxref("AudioNode")}} that acts as an audio source.
{{domxref("MediaStreamAudioSourceNode")}}
The MediaStreamAudioSourceNode interface represents an audio source consisting of a WebRTC {{domxref("MediaStream")}} (such as a webcam or microphone). It is an {{domxref("AudioNode")}} that acts as an audio source.

Defining audio effects filters

Interfaces for defining effects that you want to apply to your audio sources.

{{domxref("BiquadFilterNode")}}
The BiquadFilterNode interface represents a simple low-order filter. It is an {{domxref("AudioNode")}} that can represent different kinds of filters, tone control devices or graphic equalizers. A BiquadFilterNode always has exactly one input and one output.
{{domxref("ConvolverNode")}}
The ConvolverNode interface is an {{domxref("AudioNode")}} that performs a Linear Convolution on a given AudioBuffer, often used to achieve a reverb effect.
{{domxref("DelayNode")}}
The DelayNode interface represents a delay-line; an {{domxref("AudioNode")}} audio-processing module that causes a delay between the arrival of an input data and its propagation to the output.
{{domxref("DynamicsCompressorNode")}}
The DynamicsCompressorNode interface provides a compression effect, which lowers the volume of the loudest parts of the signal in order to help prevent clipping and distortion that can occur when multiple sounds are played and multiplexed together at once.
{{domxref("GainNode")}}
The GainNode interface represents a change in volume. It is an {{domxref("AudioNode")}} audio-processing module that causes a given gain to be applied to the input data before its propagation to the output.
{{domxref("StereoPannerNode")}}
The StereoPannerNode interface represents a simple stereo panner node  that can be used to pan an audio stream left or right.
{{domxref("WaveShaperNode")}}
The WaveShaperNode interface represents a non-linear distorter. It is an {{domxref("AudioNode")}} that use a curve to apply a waveshaping distortion to the signal. Beside obvious distortion effects, it is often used to add a warm feeling to the signal.
{{domxref("PeriodicWave")}}
Used to define a periodic waveform that can be used to shape the output of an {{ domxref("OscillatorNode") }}.

Defining audio destinations

Once you are done processing your audio, these interfaces define where to output it.

{{domxref("AudioDestinationNode")}}
The AudioDestinationNode interface represents the end destination of an audio source in a given context — usually the speakers of your device.
{{domxref("MediaStreamAudioDestinationNode")}}
The MediaStreamAudioDestinationNode interface represents an audio destination consisting of a WebRTC {{domxref("MediaStream")}} with a single AudioMediaStreamTrack, which can be used in a similar way to a MediaStream obtained from {{ domxref("Navigator.getUserMedia") }}. It is an {{domxref("AudioNode")}} that acts as an audio destination.

Data analysis and visualisation

If you want to extract time, frequency and other data from your audio, the AnalyserNode is what you need.

{{domxref("AnalyserNode")}}
The AnalyserNode interface represents a node able to provide real-time frequency and time-domain analysis information, for the purposes of data analysis and visualization.

Splitting and merging audio channels

To split and merge audio channels, you'll use these interfaces.

{{domxref("ChannelSplitterNode")}}
The ChannelSplitterNode interface separates the different channels of an audio source out into a set of mono outputs.
{{domxref("ChannelMergerNode")}}
The ChannelMergerNode interface reunites different mono inputs into a single output. Each input will be used to fill a channel of the output.

Audio spatialization

These interfaces allow you to add audio spatialization panning effects to your audio sources.

{{domxref("AudioListener")}}
The AudioListener interface represents the position and orientation of the unique person listening to the audio scene used in audio spatialization.
{{domxref("PannerNode")}}
The PannerNode interface represents the behavior of a signal in space. It is an {{domxref("AudioNode")}} audio-processing module describing its position with right-hand Cartesian coordinates, its movement using a velocity vector and its directionality using a directionality cone.

Audio processing via JavaScript

If you want to use an external script to process your audio source, the below Node and events make it possible.

Note: As of the August 29 2014 Web Audio API spec publication, these features have been marked as deprecated, and are soon to be replaced by {{ anch("Audio_Workers") }}.

{{domxref("ScriptProcessorNode")}}
The ScriptProcessorNode interface allows the generation, processing, or analyzing of audio using JavaScript. It is an {{domxref("AudioNode")}} audio-processing module that is linked to two buffers, one containing the current input, one containing the output. An event, implementing the {{domxref("AudioProcessingEvent")}} interface, is sent to the object each time the input buffer contains new data, and the event handler terminates when it has filled the output buffer with data.
{{event("audioprocess")}} (event)
The audioprocess event is fired when an input buffer of a Web Audio API {{domxref("ScriptProcessorNode")}} is ready to be processed.
{{domxref("AudioProcessingEvent")}}
The Web Audio API AudioProcessingEvent represents events that occur when a {{domxref("ScriptProcessorNode")}} input buffer is ready to be processed.

Offline/background audio processing

It is possible to process/render an audio graph very quickly in the background — rendering it to an {{domxref("AudioBuffer")}} rather than to the device's speakers — with the following.

{{domxref("OfflineAudioContext")}}
The OfflineAudioContext interface is an {{domxref("AudioContext")}} interface representing an audio-processing graph built from linked together {{domxref("AudioNode")}}s. In contrast with a standard AudioContext, an OfflineAudioContext doesn't really render the audio but rather generates it, as fast as it can, in a buffer.
{{event("complete")}} (event)
The complete event is fired when the rendering of an {{domxref("OfflineAudioContext")}} is terminated.
{{domxref("OfflineAudioCompletionEvent")}}
The OfflineAudioCompletionEvent represents events that occur when the processing of an {{domxref("OfflineAudioContext")}} is terminated. The {{event("complete")}} event implements this interface.

Audio Workers

Audio workers provide the ability for direct scripted audio processing to be done inside a web worker context, and are defined by a couple of interfaces (new as of 29th August 2014.) These are not implemented in any browsers yet. When implemented, they will replace {{domxref("ScriptProcessorNode")}}, and the other features discussed in the Audio processing via JavaScript section above.

{{domxref("AudioWorkerNode")}}
The AudioWorkerNode interface represents an {{domxref("AudioNode")}} that interacts with a worker thread to generate, process, or analyse audio directly.
{{domxref("AudioWorkerGlobalScope")}}
The AudioWorkerGlobalScope interface is a DedicatedWorkerGlobalScope-derived object representing a worker context in which an audio processing script is run; it is designed to enable the generation, processing, and analysis of audio data directly using JavaScript in a worker thread.
{{domxref("AudioProcessEvent")}}
This is an Event object that is dispatched to {{domxref("AudioWorkerGlobalScope")}} objects to perform processing.

Obsolete interfaces

The following interfaces were defined in old versions of the Web Audio API spec, but are now obsolete and have been replaced by other interfaces.

{{domxref("JavaScriptNode")}}
Used for direct audio processing via JavaScript. This interface is obsolete, and has been replaced by {{domxref("ScriptProcessorNode")}}.
{{domxref("WaveTableNode")}}
Used to define a periodic waveform. This interface is obsolete, and has been replaced by {{domxref("PeriodicWave")}}.

Example

This example shows a wide variety of Web Audio API functions being used. You can see this code in action on the Voice-change-o-matic demo (also check out the full source code at Github) — this is an experimental voice changer toy demo; keep your speakers turned down low when you use it, at least to start!

The Web Audio API lines are highlighted; if you want to find more out about what the different methods, etc. do, have a search around the reference pages.

var audioCtx = new (window.AudioContext || window.webkitAudioContext)(); // define audio context
// Webkit/blink browsers need prefix, Safari won't work without window.

var voiceSelect = document.getElementById("voice"); // select box for selecting voice effect options
var visualSelect = document.getElementById("visual"); // select box for selecting audio visualization options
var mute = document.querySelector('.mute'); // mute button
var drawVisual; // requestAnimationFrame

var analyser = audioCtx.createAnalyser();
var distortion = audioCtx.createWaveShaper();
var gainNode = audioCtx.createGain();
var biquadFilter = audioCtx.createBiquadFilter();

function makeDistortionCurve(amount) { // function to make curve shape for distortion/wave shaper node to use
  var k = typeof amount === 'number' ? amount : 50,
    n_samples = 44100,
    curve = new Float32Array(n_samples),
    deg = Math.PI / 180,
    i = 0,
    x;
  for ( ; i < n_samples; ++i ) {
    x = i * 2 / n_samples - 1;
    curve[i] = ( 3 + k ) * x * 20 * deg / ( Math.PI + k * Math.abs(x) );
  }
  return curve;
};

navigator.getUserMedia (
  // constraints - only audio needed for this app
  {
    audio: true
  },

  // Success callback
  function(stream) {
    source = audioCtx.createMediaStreamSource(stream);
    source.connect(analyser);
    analyser.connect(distortion);
    distortion.connect(biquadFilter);
    biquadFilter.connect(gainNode);
    gainNode.connect(audioCtx.destination); // connecting the different audio graph nodes together

    visualize(stream);
    voiceChange();

  },

  // Error callback
  function(err) {
    console.log('The following gUM error occured: ' + err);
  }
);

function visualize(stream) {
  WIDTH = canvas.width;
  HEIGHT = canvas.height;

  var visualSetting = visualSelect.value;
  console.log(visualSetting);

  if(visualSetting == "sinewave") {
    analyser.fftSize = 2048;
    var bufferLength = analyser.frequencyBinCount; // half the FFT value
    var dataArray = new Uint8Array(bufferLength); // create an array to store the data

    canvasCtx.clearRect(0, 0, WIDTH, HEIGHT);

    function draw() {

      drawVisual = requestAnimationFrame(draw);

      analyser.getByteTimeDomainData(dataArray); // get waveform data and put it into the array created above

      canvasCtx.fillStyle = 'rgb(200, 200, 200)'; // draw wave with canvas
      canvasCtx.fillRect(0, 0, WIDTH, HEIGHT);

      canvasCtx.lineWidth = 2;
      canvasCtx.strokeStyle = 'rgb(0, 0, 0)';

      canvasCtx.beginPath();

      var sliceWidth = WIDTH * 1.0 / bufferLength;
      var x = 0;

      for(var i = 0; i < bufferLength; i++) {

        var v = dataArray[i] / 128.0;
        var y = v * HEIGHT/2;

        if(i === 0) {
          canvasCtx.moveTo(x, y);
        } else {
          canvasCtx.lineTo(x, y);
        }

        x += sliceWidth;
      }

      canvasCtx.lineTo(canvas.width, canvas.height/2);
      canvasCtx.stroke();
    };

    draw();

  } else if(visualSetting == "off") {
    canvasCtx.clearRect(0, 0, WIDTH, HEIGHT);
    canvasCtx.fillStyle = "red";
    canvasCtx.fillRect(0, 0, WIDTH, HEIGHT);
  }

}

function voiceChange() {
  distortion.curve = new Float32Array;
  biquadFilter.gain.value = 0; // reset the effects each time the voiceChange function is run

  var voiceSetting = voiceSelect.value;
  console.log(voiceSetting);

  if(voiceSetting == "distortion") {
    distortion.curve = makeDistortionCurve(400); // apply distortion to sound using waveshaper node
  } else if(voiceSetting == "biquad") {
    biquadFilter.type = "lowshelf";
    biquadFilter.frequency.value = 1000;
    biquadFilter.gain.value = 25; // apply lowshelf filter to sounds using biquad
  } else if(voiceSetting == "off") {
    console.log("Voice settings turned off"); // do nothing, as off option was chosen
  }

}

// event listeners to change visualize and voice settings

visualSelect.onchange = function() {
  window.cancelAnimationFrame(drawVisual);
  visualize(stream);
}

voiceSelect.onchange = function() {
  voiceChange();
}

mute.onclick = voiceMute;

function voiceMute() { // toggle to mute and unmute sound
  if(mute.id == "") {
    gainNode.gain.value = 0; // gain set to 0 to mute sound
    mute.id = "activated";
    mute.innerHTML = "Unmute";
  } else {
    gainNode.gain.value = 1; // gain set to 1 to unmute sound
    mute.id = "";    
    mute.innerHTML = "Mute";
  }
}

Specifications

Specification Status Comment
{{SpecName('Web Audio API')}} {{Spec2('Web Audio API')}}  

Browser compatibility

{{CompatibilityTable}}
Feature Chrome Edge Firefox (Gecko) Internet Explorer Opera Safari (WebKit)
Basic support 14 {{property_prefix("webkit")}} {{CompatVersionUnknown}} 23 {{CompatNo}} 15 {{property_prefix("webkit")}}
22 (unprefixed)
6 {{property_prefix("webkit")}}
Feature Android Chrome Firefox Mobile (Gecko) Firefox OS IE Phone Opera Mobile Safari Mobile
Basic support {{CompatNo}} 28 {{property_prefix("webkit")}} 25 1.2 {{CompatNo}} {{CompatNo}} 6 {{property_prefix("webkit")}}

See also

Revision Source

<div>
<p>The Web Audio API provides a powerful and versatile system for controlling audio on the Web, allowing developers to choose audio sources, add effects to audio, create audio visualizations, apply spatial effects (such as panning)&nbsp; and much more.</p>
</div>

<h2 id="Web_audio_concepts_and_usage">Web audio concepts and usage</h2>

<p>The Web Audio API involves handling audio operations inside an <strong>audio context</strong>, and has been designed to allow <strong>modular routing</strong>. Basic audio operations are performed with <strong>audio nodes</strong>, which are linked together to form an <strong>audio routing graph</strong>. Several sources — with different types of channel layout — are supported even within a single context. This modular design provides the flexibility to create complex audio functions with dynamic effects.</p>

<p>Audio nodes are linked into chains and simple webs by their inputs and outputs. They typically start with one or more sources. Sources provide arrays of sound intensities (samples) at very small timeslices, often tens of thousands of them per second. These could be either computed mathematically (see: <a href="/en-US/docs/Web/API/OscillatorNode">OscillatorNode</a>), or they can be recordings from sound/video files (see: <a href="/en-US/docs/Web/API/AudioBufferSourceNode">AudioBufferSourceNode</a> and <a href="/en-US/docs/Web/API/MediaElementAudioSourceNode">MediaElementAudioSourceNode</a>) and audio streams (see: <a href="/en-US/docs/Web/API/MediaStreamAudioSourceNode">MediaStreamAudioSourceNode</a>). In fact, sound files are just recordings of sound intensities themselves, which come in from microphones or electric instruments, and get mixed down into a single, complicated wave. Outputs of these nodes could be linked to inputs of others, which mix or modify these streams of sound samples into different streams. A common modification is multiplying the samples by a value to make them louder or quieter (see: <a href="/en-US/docs/Web/API/GainNode">GainNode</a>). Once the sound has been sufficiently processed for the intended effect, it can be linked to the input of a destination (see: <a href="/en-US/docs/Web/API/AudioContext/destination">AudioContext.destination</a>) that sends it to the speakers or headphones. This last connection is only necessary if the user is supposed to hear the audio.</p>

<p>A simple, typical workflow for web audio would look something like this:</p>

<ol>
 <li>Create audio context</li>
 <li>Inside the context, create sources — such as <code>&lt;audio&gt;</code>, oscillator, stream</li>
 <li>Create effects nodes, such as reverb, biquad filter, panner, compressor</li>
 <li>Choose final destination of audio, for example your system speakers</li>
 <li>Connect the sources up to the effects, and the effects to the destination.</li>
</ol>

<p><img alt="A simple box diagram with an outer box labeled Audio context, and three inner boxes labeled Sources, Effects and Destination. The three inner boxes have arrow between them pointing from left to right, indicating the flow of audio information." src="https://mdn.mozillademos.org/files/7893/web-audio-api-flowchart.png" style="display:block; height:113px; margin:0px auto; width:635px" /></p>

<p>Timing is controlled with high precision and low latency, allowing developers to write code that responds accurately to events and is able to target specific samples, even at a high sample rate. So applications such as drum machines and sequencers are well within reach.</p>

<p>The Web Audio API also allows us to control how audio is <em>spatialized</em>. Using a system based on a <em>source-listener model</em>, it allows control of the <em>panning model</em> and deals with <em>distance-induced attenuation</em> or <em>doppler shift</em> induced by a moving source (or moving listener).</p>

<div class="note">
<p><strong>Note</strong>: You can read about the theory of the Web Audio API in a lot more detail in our article <a href="/en-US/docs/Web/API/Web_Audio_API/Basic_concepts_behind_Web_Audio_API">Basic concepts behind Web Audio API</a>.</p>
</div>

<h2 id="Web_Audio_API_Interfaces">Web Audio API Interfaces</h2>

<p>The Web Audio API has a total of 28 interfaces and associated events, which we have split up into nine categories of functionality.</p>

<h3 id="General_audio_graph_definition">General audio graph definition</h3>

<p>General containers and definitions that shape audio graphs in Web Audio API usage.</p>

<dl>
 <dt>{{domxref("AudioContext")}}</dt>
 <dd>The <strong><code>AudioContext</code></strong> interface represents an audio-processing graph built from audio modules linked together, each represented by an {{domxref("AudioNode")}}. An audio context controls the creation of the nodes it contains and the execution of the audio processing, or decoding. You need to create an <code>AudioContext</code> before you do anything else, as everything happens inside a context.</dd>
 <dt>{{domxref("AudioNode")}}</dt>
 <dd>The <strong><code>AudioNode</code></strong><strong> </strong>interface represents an audio-processing module like an <em>audio source</em> (e.g. an HTML {{HTMLElement("audio")}} or {{HTMLElement("video")}} element), <em>audio destination</em>, <em>intermediate processing module</em> (e.g. a filter like {{domxref("BiquadFilterNode")}}, or volume control like {{domxref("GainNode")}}).</dd>
 <dt>{{domxref("AudioParam")}}</dt>
 <dd>The <strong><code>AudioParam</code></strong><strong> </strong>interface represents an audio-related parameter, like one of an {{domxref("AudioNode")}}. It can be set to a specific value or a change in value, and can be scheduled to happen at a specific time and following a specific pattern.</dd>
 <dt>{{event("ended_(Web_Audio)", "ended")}} (event)</dt>
 <dd>The <code>ended</code> event is fired when playback has stopped because the end of the media was reached.</dd>
</dl>

<h3 id="Defining_audio_sources">Defining audio sources</h3>

<p>Interfaces that define audio sources for use in the Web Audio API.</p>

<dl>
 <dt>{{domxref("OscillatorNode")}}</dt>
 <dd>The&nbsp;<strong><code style="font-size: 14px;">OscillatorNode</code></strong><strong>&nbsp;</strong>interface represents a sine wave. It is an {{domxref("AudioNode")}} audio-processing module that causes a given&nbsp;<em>frequency</em>&nbsp;of sine wave to be created.</dd>
 <dt>{{domxref("AudioBuffer")}}</dt>
 <dd>The <strong><code>AudioBuffer</code></strong> interface represents a short audio asset residing in memory, created from an audio file using the {{ domxref("AudioContext.decodeAudioData()") }} method, or created with raw data using {{ domxref("AudioContext.createBuffer()") }}. Once decoded into this form, the audio can then be put into an {{ domxref("AudioBufferSourceNode") }}.</dd>
 <dt>{{domxref("AudioBufferSourceNode")}}</dt>
 <dd>The <strong><code>AudioBufferSourceNode</code></strong> interface represents an audio source consisting of in-memory audio data, stored in an {{domxref("AudioBuffer")}}. It is an {{domxref("AudioNode")}} that acts as an audio source.</dd>
 <dt>{{domxref("MediaElementAudioSourceNode")}}</dt>
 <dd>The <code><strong>MediaElementAudio</strong></code><strong><code>SourceNode</code></strong> interface represents an audio source consisting of an HTML5 {{ htmlelement("audio") }} or {{ htmlelement("video") }} element. It is an {{domxref("AudioNode")}} that acts as an audio source.</dd>
 <dt>{{domxref("MediaStreamAudioSourceNode")}}</dt>
 <dd>The <code><strong>MediaStreamAudio</strong></code><strong><code>SourceNode</code></strong> interface represents an audio source consisting of a <a href="/en-US/docs/WebRTC" title="/en-US/docs/WebRTC">WebRTC</a> {{domxref("MediaStream")}} (such as a webcam or microphone). It is an {{domxref("AudioNode")}} that acts as an audio source.</dd>
</dl>

<h3 id="Defining_audio_effects_filters">Defining audio effects filters</h3>

<p>Interfaces for defining effects that you want to apply to your audio sources.</p>

<dl>
 <dt>{{domxref("BiquadFilterNode")}}</dt>
 <dd>The <strong><code>BiquadFilterNode</code></strong><strong> </strong>interface represents a simple low-order filter. It is an {{domxref("AudioNode")}} that can represent different kinds of filters, tone control devices or graphic equalizers. A <code>BiquadFilterNode</code> always has exactly one input and one output.</dd>
 <dt>{{domxref("ConvolverNode")}}</dt>
 <dd>The <code><strong>Convolver</strong></code><strong><code>Node</code></strong><strong> </strong>interface is an&nbsp;<span style="line-height:1.5">{{domxref("AudioNode")}} that</span><span style="line-height:1.5">&nbsp;performs a Linear Convolution on a given AudioBuffer, often used to achieve a reverb effect</span><span style="line-height:1.5">.</span></dd>
 <dt>{{domxref("DelayNode")}}</dt>
 <dd>The <strong><code>DelayNode</code></strong><strong> </strong>interface represents a <a href="https://en.wikipedia.org/wiki/Digital_delay_line" title="https://en.wikipedia.org/wiki/Digital_delay_line">delay-line</a>; an {{domxref("AudioNode")}} audio-processing module that causes a delay between the arrival of an input data and its propagation to the output.</dd>
 <dt>{{domxref("DynamicsCompressorNode")}}</dt>
 <dd>The <strong><code>DynamicsCompressorNode</code></strong> interface provides a compression effect, which lowers the volume of the loudest parts of the signal in order to help prevent clipping and distortion that can occur when multiple sounds are played and multiplexed together at once.</dd>
 <dt>{{domxref("GainNode")}}</dt>
 <dd>The <strong><code>GainNode</code></strong><strong> </strong>interface represents a change in volume. It is an {{domxref("AudioNode")}} audio-processing module that causes a given <em>gain</em> to be applied to the input data before its propagation to the output.</dd>
 <dt>{{domxref("StereoPannerNode")}}</dt>
 <dd>The <code><strong>StereoPannerNode</strong></code> interface represents a simple stereo panner node&nbsp; that can be used to pan an audio stream left or right.</dd>
 <dt>{{domxref("WaveShaperNode")}}</dt>
 <dd>The <strong><code>WaveShaperNode</code></strong><strong> </strong>interface represents a non-linear distorter. It is an {{domxref("AudioNode")}} that use a curve to apply a waveshaping distortion to the signal. Beside obvious distortion effects, it is often used to add a warm feeling to the signal.</dd>
 <dt>{{domxref("PeriodicWave")}}</dt>
 <dd>Used to define a periodic waveform that can be used to shape the output of an {{ domxref("OscillatorNode") }}.</dd>
</dl>

<h3 id="Defining_audio_destinations">Defining audio destinations</h3>

<p>Once you are done processing your audio, these interfaces define where to output it.</p>

<dl>
 <dt>{{domxref("AudioDestinationNode")}}</dt>
 <dd>The <strong><code>AudioDestinationNode</code></strong> interface represents the end destination of an audio source in a given context — usually the speakers of your device.</dd>
 <dt>{{domxref("MediaStreamAudioDestinationNode")}}</dt>
 <dd>The <code><strong>MediaStreamAudio</strong></code><strong><code>DestinationNode</code></strong> interface represents an audio destination consisting of a <a href="/en-US/docs/WebRTC" title="/en-US/docs/WebRTC">WebRTC</a> {{domxref("MediaStream")}} with a single <code>AudioMediaStreamTrack</code>, which can be used in a similar way to a MediaStream obtained from {{ domxref("Navigator.getUserMedia") }}. It is an {{domxref("AudioNode")}} that acts as an audio destination.</dd>
</dl>

<h3 id="Data_analysis_and_visualisation">Data analysis and visualisation</h3>

<p>If you want to extract time, frequency and other data from your audio, the <code>AnalyserNode</code> is what you need.</p>

<dl>
 <dt>{{domxref("AnalyserNode")}}</dt>
 <dd>The <strong><code>AnalyserNode</code></strong> interface represents a node able to provide real-time frequency and time-domain analysis information, for the purposes of data analysis and visualization.</dd>
</dl>

<h3 id="Splitting_and_merging_audio_channels">Splitting and merging audio channels</h3>

<p>To split and merge audio channels, you'll use these interfaces.</p>

<dl>
 <dt>{{domxref("ChannelSplitterNode")}}</dt>
 <dd>The <code><strong>ChannelSplitterNode</strong></code> interface separates the different channels of an audio source out into a set of <em>mono</em> outputs.</dd>
 <dt>{{domxref("ChannelMergerNode")}}</dt>
 <dd>The <code><strong>ChannelMergerNode</strong></code> interface reunites different mono inputs into a single output. Each input will be used to fill a channel of the output.</dd>
</dl>

<h3 id="Audio_spatialization">Audio spatialization</h3>

<p>These interfaces allow you to add audio spatialization panning effects to your audio sources.</p>

<dl>
 <dt>{{domxref("AudioListener")}}</dt>
 <dd>The <strong><code>AudioListener</code></strong><strong> </strong>interface represents the position and orientation of the unique person listening to the audio scene used in audio spatialization.</dd>
 <dt>{{domxref("PannerNode")}}</dt>
 <dd>The <strong><code>PannerNode</code></strong><strong> </strong>interface represents the behavior of a signal in space. It is an {{domxref("AudioNode")}} audio-processing module describing its position with right-hand Cartesian coordinates, its movement using a velocity vector and its directionality using a directionality cone.</dd>
</dl>

<h3 id="Audio_processing_via_JavaScript">Audio processing via JavaScript</h3>

<p>If you want to use an external script to process your audio source, the below Node and events make it possible.</p>

<div class="note">
<p><strong>Note</strong>: As of the August 29 2014 Web Audio API spec publication, these features have been marked as deprecated, and are soon to be replaced by {{ anch("Audio_Workers") }}.</p>
</div>

<dl>
 <dt>{{domxref("ScriptProcessorNode")}}</dt>
 <dd>The <strong><code>ScriptProcessorNode</code></strong><strong> </strong>interface allows the generation, processing, or analyzing of audio using JavaScript. It is an {{domxref("AudioNode")}} audio-processing module that is linked to two buffers, one containing the current input, one containing the output. An event, implementing the {{domxref("AudioProcessingEvent")}} interface, is sent to the object each time the input buffer contains new data, and the event handler terminates when it has filled the output buffer with data.</dd>
 <dt>{{event("audioprocess")}} (event)</dt>
 <dd>The <code>audioprocess</code> event is fired when an input buffer of a Web Audio API {{domxref("ScriptProcessorNode")}} is ready to be processed.</dd>
 <dt>{{domxref("AudioProcessingEvent")}}</dt>
 <dd>The <a href="/en-US/docs/Web_Audio_API" title="/en-US/docs/Web_Audio_API">Web Audio API</a> <code>AudioProcessingEvent</code> represents events that occur when a {{domxref("ScriptProcessorNode")}} input buffer is ready to be processed.</dd>
</dl>

<h3 id="Offlinebackground_audio_processing">Offline/background audio processing</h3>

<p>It is possible to process/render an audio graph very quickly in the background — rendering it to an {{domxref("AudioBuffer")}} rather than to the device's speakers — with the following.</p>

<dl>
 <dt>{{domxref("OfflineAudioContext")}}</dt>
 <dd>The <strong><code>OfflineAudioContext</code></strong> interface is an {{domxref("AudioContext")}} interface representing an audio-processing graph built from linked together {{domxref("AudioNode")}}s. In contrast with a standard <code>AudioContext</code>, an <code>OfflineAudioContext</code> doesn't really render the audio but rather generates it, <em>as fast as it can</em>, in a buffer.</dd>
 <dt>{{event("complete")}} (event)</dt>
 <dd>The <code>complete</code> event is fired when the rendering of an {{domxref("OfflineAudioContext")}} is terminated.</dd>
 <dt>{{domxref("OfflineAudioCompletionEvent")}}</dt>
 <dd>The <code>OfflineAudioCompletionEvent</code> represents events that occur when the processing of an {{domxref("OfflineAudioContext")}} is terminated. The {{event("complete")}} event implements this interface.</dd>
</dl>

<h3 id="Audio_Workers" name="Audio_Workers">Audio Workers</h3>

<p>Audio workers provide the ability for direct scripted audio processing to be done inside a <a href="/en-US/docs/Web/Guide/Performance/Using_web_workers">web worker</a> context, and are defined by a couple of interfaces (new as of 29th August 2014.) These are not implemented in any browsers yet. When implemented, they will replace {{domxref("ScriptProcessorNode")}}, and the other features discussed in the <a href="#Audio_processing_via_JavaScript">Audio processing via JavaScript</a> section above.</p>

<dl>
 <dt>{{domxref("AudioWorkerNode")}}</dt>
 <dd>The AudioWorkerNode interface represents an {{domxref("AudioNode")}} that interacts with a worker thread to generate, process, or analyse audio directly.</dd>
 <dt>{{domxref("AudioWorkerGlobalScope")}}</dt>
 <dd>The <code>AudioWorkerGlobalScope</code> interface is a <code>DedicatedWorkerGlobalScope</code>-derived object representing a worker context in which an audio processing script is run; it is designed to enable the generation, processing, and analysis of audio data directly using JavaScript in a worker thread.</dd>
 <dt>{{domxref("AudioProcessEvent")}}</dt>
 <dd>This is an <code>Event</code> object that is dispatched to {{domxref("AudioWorkerGlobalScope")}} objects to perform processing.</dd>
</dl>

<h2 id="Example" name="Example">Obsolete interfaces</h2>

<p>The following interfaces were defined in old versions of the Web Audio API spec, but are now obsolete and have been replaced by other interfaces.</p>

<dl>
 <dt>{{domxref("JavaScriptNode")}}</dt>
 <dd>Used for direct audio processing via JavaScript. This interface is obsolete, and has been replaced by {{domxref("ScriptProcessorNode")}}.</dd>
 <dt>{{domxref("WaveTableNode")}}</dt>
 <dd>Used to define a periodic waveform. This interface is obsolete, and has been replaced by {{domxref("PeriodicWave")}}.</dd>
</dl>

<h2 id="Example" name="Example">Example</h2>

<p>This example shows a wide variety of Web Audio API functions being used. You can see this code in action on the <a href="https://mdn.github.io/voice-change-o-matic/">Voice-change-o-matic</a> demo (also check out the <a href="https://github.com/mdn/voice-change-o-matic">full source code at Github</a>) — this is an experimental voice changer toy demo; keep your speakers turned down low when you use it, at least to start!</p>

<p>The Web Audio API lines are highlighted; if you want to find more out about what the different methods, etc. do, have a search around the reference pages.</p>

<pre class="brush: js; highlight:[1,2,9,10,11,12,36,37,38,39,40,41,62,63,72,114,115,121,123,124,125,147,151]">
var audioCtx = new (window.AudioContext || window.webkitAudioContext)(); // define audio context
// Webkit/blink browsers need prefix, Safari won't work without window.

var voiceSelect = document.getElementById("voice"); // select box for selecting voice effect options
var visualSelect = document.getElementById("visual"); // select box for selecting audio visualization options
var mute = document.querySelector('.mute'); // mute button
var drawVisual; // requestAnimationFrame

var analyser = audioCtx.createAnalyser();
var distortion = audioCtx.createWaveShaper();
var gainNode = audioCtx.createGain();
var biquadFilter = audioCtx.createBiquadFilter();

function makeDistortionCurve(amount) { // function to make curve shape for distortion/wave shaper node to use
&nbsp; var k = typeof amount === 'number' ? amount : 50,
&nbsp;&nbsp;&nbsp; n_samples = 44100,
&nbsp;&nbsp;&nbsp; curve = new Float32Array(n_samples),
&nbsp;&nbsp;&nbsp; deg = Math.PI / 180,
&nbsp;&nbsp;&nbsp; i = 0,
&nbsp;&nbsp;&nbsp; x;
&nbsp; for ( ; i &lt; n_samples; ++i ) {
&nbsp;&nbsp;&nbsp; x = i * 2 / n_samples - 1;
&nbsp;&nbsp;&nbsp; curve[i] = ( 3 + k ) * x * 20 * deg / ( Math.PI + k * Math.abs(x) );
&nbsp; }
&nbsp; return curve;
};

navigator.getUserMedia (
&nbsp; // constraints - only audio needed for this app
&nbsp; {
&nbsp;&nbsp;&nbsp; audio: true
&nbsp; },

&nbsp; // Success callback
&nbsp; function(stream) {
&nbsp;&nbsp;&nbsp; source = audioCtx.createMediaStreamSource(stream);
&nbsp;&nbsp;&nbsp; source.connect(analyser);
&nbsp;&nbsp;&nbsp; analyser.connect(distortion);
&nbsp;&nbsp;&nbsp; distortion.connect(biquadFilter);
&nbsp;&nbsp;&nbsp; biquadFilter.connect(gainNode);
&nbsp;&nbsp;&nbsp; gainNode.connect(audioCtx.destination); // connecting the different audio graph nodes together

&nbsp;&nbsp; &nbsp;visualize(stream);
&nbsp;&nbsp;&nbsp; voiceChange();

&nbsp; },

&nbsp; // Error callback
&nbsp; function(err) {
&nbsp;&nbsp;&nbsp; console.log('The following gUM error occured: ' + err);
&nbsp; }
);

function visualize(stream) {
&nbsp; WIDTH = canvas.width;
&nbsp; HEIGHT = canvas.height;

&nbsp; var visualSetting = visualSelect.value;
&nbsp; console.log(visualSetting);

&nbsp; if(visualSetting == "sinewave") {
&nbsp;&nbsp;&nbsp; analyser.fftSize = 2048;
&nbsp;&nbsp;&nbsp; var bufferLength = analyser.frequencyBinCount; // half the FFT value
&nbsp;&nbsp;&nbsp; var dataArray = new Uint8Array(bufferLength); // create an array to store the data

&nbsp;&nbsp;&nbsp; canvasCtx.clearRect(0, 0, WIDTH, HEIGHT);

&nbsp;&nbsp;&nbsp; function draw() {

&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; drawVisual = requestAnimationFrame(draw);

&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; analyser.getByteTimeDomainData(dataArray); // get waveform data and put it into the array created above

&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; canvasCtx.fillStyle = 'rgb(200, 200, 200)'; // draw wave with canvas
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; canvasCtx.fillRect(0, 0, WIDTH, HEIGHT);

&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; canvasCtx.lineWidth = 2;
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; canvasCtx.strokeStyle = 'rgb(0, 0, 0)';

&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; canvasCtx.beginPath();

&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; var sliceWidth = WIDTH * 1.0 / bufferLength;
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; var x = 0;

&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; for(var i = 0; i &lt; bufferLength; i++) {

&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; var v = dataArray[i] / 128.0;
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; var y = v * HEIGHT/2;

&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; if(i === 0) {
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; canvasCtx.moveTo(x, y);
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; } else {
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; canvasCtx.lineTo(x, y);
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; }

&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; x += sliceWidth;
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; }

&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; canvasCtx.lineTo(canvas.width, canvas.height/2);
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; canvasCtx.stroke();
&nbsp;&nbsp;&nbsp; };

&nbsp;&nbsp;&nbsp; draw();

&nbsp; } else if(visualSetting == "off") {
&nbsp;&nbsp;&nbsp; canvasCtx.clearRect(0, 0, WIDTH, HEIGHT);
&nbsp;&nbsp;&nbsp; canvasCtx.fillStyle = "red";
&nbsp;&nbsp;&nbsp; canvasCtx.fillRect(0, 0, WIDTH, HEIGHT);
&nbsp; }

}

function voiceChange() {
&nbsp; distortion.curve = new Float32Array;
&nbsp; biquadFilter.gain.value = 0; // reset the effects each time the voiceChange function is run

&nbsp; var voiceSetting = voiceSelect.value;
&nbsp; console.log(voiceSetting);

&nbsp; if(voiceSetting == "distortion") {
&nbsp;&nbsp;&nbsp; distortion.curve = makeDistortionCurve(400); // apply distortion to sound using waveshaper node
&nbsp; } else if(voiceSetting == "biquad") {
&nbsp;&nbsp;&nbsp; biquadFilter.type = "lowshelf";
&nbsp;&nbsp;&nbsp; biquadFilter.frequency.value = 1000;
&nbsp;&nbsp;&nbsp; biquadFilter.gain.value = 25; // apply lowshelf filter to sounds using biquad
&nbsp; } else if(voiceSetting == "off") {
&nbsp;&nbsp;&nbsp; console.log("Voice settings turned off"); // do nothing, as off option was chosen
&nbsp; }

}

// event listeners to change visualize and voice settings

visualSelect.onchange = function() {
&nbsp; window.cancelAnimationFrame(drawVisual);
&nbsp; visualize(stream);
}

voiceSelect.onchange = function() {
&nbsp; voiceChange();
}

mute.onclick = voiceMute;

function voiceMute() { // toggle to mute and unmute sound
&nbsp; if(mute.id == "") {
&nbsp;&nbsp;&nbsp; gainNode.gain.value = 0; // gain set to 0 to mute sound
&nbsp;&nbsp;&nbsp; mute.id = "activated";
&nbsp;&nbsp;&nbsp; mute.innerHTML = "Unmute";
&nbsp; } else {
&nbsp;&nbsp;&nbsp; gainNode.gain.value = 1; // gain set to 1 to unmute sound
&nbsp;&nbsp;&nbsp; mute.id = "";&nbsp;&nbsp; &nbsp;
&nbsp;&nbsp;&nbsp; mute.innerHTML = "Mute";
&nbsp; }
}
</pre>

<h2 id="Specifications">Specifications</h2>

<table class="standard-table">
 <tbody>
  <tr>
   <th scope="col">Specification</th>
   <th scope="col">Status</th>
   <th scope="col">Comment</th>
  </tr>
  <tr>
   <td>{{SpecName('Web Audio API')}}</td>
   <td>{{Spec2('Web Audio API')}}</td>
   <td>&nbsp;</td>
  </tr>
 </tbody>
</table>

<h2 id="Browser_compatibility">Browser compatibility</h2>

<div>{{CompatibilityTable}}</div>

<div id="compat-desktop">
<table class="compat-table">
 <tbody>
  <tr>
   <th>Feature</th>
   <th>Chrome</th>
   <th>Edge</th>
   <th>Firefox (Gecko)</th>
   <th>Internet Explorer</th>
   <th>Opera</th>
   <th>Safari (WebKit)</th>
  </tr>
  <tr>
   <td>Basic support</td>
   <td>14 {{property_prefix("webkit")}}</td>
   <td>{{CompatVersionUnknown}}</td>
   <td>23</td>
   <td>{{CompatNo}}</td>
   <td>15&nbsp;{{property_prefix("webkit")}}<br />
    22 (unprefixed)</td>
   <td>6 {{property_prefix("webkit")}}</td>
  </tr>
 </tbody>
</table>
</div>

<div id="compat-mobile">
<table class="compat-table">
 <tbody>
  <tr>
   <th>Feature</th>
   <th>Android</th>
   <th>Chrome</th>
   <th>Firefox Mobile (Gecko)</th>
   <th>Firefox OS</th>
   <th>IE Phone</th>
   <th>Opera Mobile</th>
   <th>Safari Mobile</th>
  </tr>
  <tr>
   <td>Basic support</td>
   <td>{{CompatNo}}</td>
   <td>28&nbsp;{{property_prefix("webkit")}}</td>
   <td>25</td>
   <td>1.2</td>
   <td>{{CompatNo}}</td>
   <td>{{CompatNo}}</td>
   <td>6&nbsp;{{property_prefix("webkit")}}</td>
  </tr>
 </tbody>
</table>
</div>

<h2 id="See_also">See also</h2>

<ul>
 <li><a href="/en-US/docs/Web/API/Web_Audio_API/Using_Web_Audio_API">Using the Web Audio API</a></li>
 <li><a href="/en-US/docs/Web/API/Web_Audio_API/Visualizations_with_Web_Audio_API">Visualizations with Web Audio API</a></li>
 <li><a href="https://mdn.github.io/voice-change-o-matic/">Voice-change-O-matic example</a></li>
 <li><a href="https://mdn.github.io/violent-theremin/">Violent Theremin example</a></li>
 <li><a href="/en-US/docs/Web/API/Web_Audio_API/Web_audio_spatialisation_basics">Web audio spatialisation basics</a></li>
 <li><a href="https://www.html5rocks.com/tutorials/webaudio/positional_audio/" title="https://www.html5rocks.com/tutorials/webaudio/positional_audio/">Mixing Positional Audio and WebGL</a></li>
 <li><a href="https://www.html5rocks.com/tutorials/webaudio/games/" title="https://www.html5rocks.com/tutorials/webaudio/games/">Developing Game Audio with the Web Audio API</a></li>
 <li><a href="/en-US/docs/Web/API/Web_Audio_API/Porting_webkitAudioContext_code_to_standards_based_AudioContext" title="/en-US/docs/Web_Audio_API/Porting_webkitAudioContext_code_to_standards_based_AudioContext">Porting webkitAudioContext code to standards based AudioContext</a></li>
 <li><a href="https://github.com/bit101/tones">Tones</a>: a simple library for playing specific tones/notes using the Web Audio API.</li>
 <li><a href="https://github.com/goldfire/howler.js/">howler.js</a>: a JS audio library that defaults to <a href="https://dvcs.w3.org/hg/audio/raw-file/tip/webaudio/specification.html">Web Audio API</a> and falls back to <a href="https://www.whatwg.org/specs/web-apps/current-work/#the-audio-element">HTML5 Audio</a>, as well as providing other useful features.</li>
 <li><a href="https://github.com/mattlima/mooog">Mooog</a>: jQuery-style chaining of AudioNodes, mixer-style sends/returns, and more.</li>
</ul>

<section id="Quick_Links">
<h3 id="Quicklinks">Quicklinks</h3>

<ol>
 <li data-closed="" data-default-state="open"><strong><a href="#">Guides</a></strong>

  <ol>
   <li><a href="/en-US/docs/Web/API/Web_Audio_API/Basic_concepts_behind_Web_Audio_API">Basic concepts behind Web Audio API</a></li>
   <li><a href="/en-US/docs/Web/API/Web_Audio_API/Using_Web_Audio_API">Using the Web Audio API</a></li>
   <li><a href="/en-US/docs/Web/API/Web_Audio_API/Visualizations_with_Web_Audio_API">Visualizations with Web Audio API</a></li>
   <li><a href="/en-US/docs/Web/API/Web_Audio_API/Web_audio_spatialisation_basics">Web audio spatialisation basics</a></li>
   <li><a href="/en-US/docs/Web/API/Web_Audio_API/Porting_webkitAudioContext_code_to_standards_based_AudioContext" title="/en-US/docs/Web_Audio_API/Porting_webkitAudioContext_code_to_standards_based_AudioContext">Porting webkitAudioContext code to standards based AudioContext</a></li>
  </ol>
 </li>
 <li data-closed="" data-default-state="open"><strong><a href="#">Examples</a></strong>
  <ol>
   <li><a href="https://mdn.github.io/voice-change-o-matic/">Voice-change-O-matic</a></li>
   <li><a href="https://mdn.github.io/violent-theremin/">Violent Theremin</a></li>
  </ol>
 </li>
 <li data-closed="" data-default-state="open"><strong><a href="#">Interfaces</a></strong>
  <ol>
   <li>{{domxref("AnalyserNode")}}</li>
   <li>{{domxref("AudioBuffer")}}</li>
   <li>{{domxref("AudioBufferSourceNode")}}</li>
   <li>{{domxref("AudioContext")}}</li>
   <li>{{domxref("AudioDestinationNode")}}</li>
   <li>{{domxref("AudioListener")}}</li>
   <li>{{domxref("AudioNode")}}</li>
   <li>{{domxref("AudioParam")}}</li>
   <li>{{event("audioprocess")}} (event)</li>
   <li>{{domxref("AudioProcessingEvent")}}</li>
   <li>{{domxref("BiquadFilterNode")}}</li>
   <li>{{domxref("ChannelMergerNode")}}</li>
   <li>{{domxref("ChannelSplitterNode")}}</li>
   <li>{{event("complete")}} (event)</li>
   <li>{{domxref("ConvolverNode")}}</li>
   <li>{{domxref("DelayNode")}}</li>
   <li>{{domxref("DynamicsCompressorNode")}}</li>
   <li>{{event("ended_(Web_Audio)", "ended")}} (event)</li>
   <li>{{domxref("GainNode")}}</li>
   <li>{{domxref("MediaElementAudioSourceNode")}}</li>
   <li>{{domxref("MediaStreamAudioDestinationNode")}}</li>
   <li>{{domxref("MediaStreamAudioSourceNode")}}</li>
   <li>{{domxref("OfflineAudioCompletionEvent")}}</li>
   <li>{{domxref("OfflineAudioContext")}}</li>
   <li>{{domxref("OscillatorNode")}}</li>
   <li>{{domxref("PannerNode")}}</li>
   <li>{{domxref("PeriodicWaveNode")}}</li>
   <li>{{domxref("ScriptProcessorNode")}}</li>
   <li>{{domxref("WaveShaperNode")}}</li>
  </ol>
 </li>
</ol>
</section>
Revert to this revision