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 664015 of AudioDestinationNode

  • Revision slug: Web/API/AudioDestinationNode
  • Revision title: AudioDestinationNode
  • Revision id: 664015
  • Created:
  • Creator: chrisdavidmills
  • Is current revision? No
  • Comment

Revision Content

{{APIRef()}}

The AudioDestinationNode interface represents the end destination of an audio source in a given context — usually the speakers of your device.

AudioDestinationNode has no output (as it is the output, no more AudioNode can be linked after it in the audio graph) and one input. The amount of channels in the input must be between 0 and the maxChannelCount value or an exception is raised.

The AudioDestinationNode of a given AudioContext can be retrieved using the {{domxref("AudioContext.destination")}} property.

  • Number of inputs 1
  • Number of outputs 0
  • Channel count mode "explicit"
  • Channel count 2
  • Channel interpretation "speakers"

Properties

Inherits properties from its parent, {{domxref("AudioNode")}}.

{{domxref("AudioDestinationNode.maxChannelCount")}}
Is an unsigned long defining the maximum amount of channels that the physical device can handle.

Methods

No specific method; inherits methods from its parent, {{domxref("AudioNode")}}.

Example

There is no complex set up for using an AudioDestinationNode — by default, this simply represents the output of the user's system (e.g. their speakers), so you can get it hooked up inside an audio graph using only a few lines of code:

var audioCtx = new AudioContext();
var source = audioCtx.createMediaElementSource(myMediaElement);
source.connect(gainNode);
gainNode.connect(audioCtx.destination);

To see a more complete implementation, check out one of our MDN Web Audio examples, such as Voice-change-o-matic or Violent Theremin.

Specifications

Specification Status Comment
{{SpecName('Web Audio API', '#the-audiodestinationnode-interface', 'AudioDestinationNode')}} {{Spec2('Web Audio API')}}  

Browser compatibility

{{CompatibilityTable}}
Feature Chrome Firefox (Gecko) Internet Explorer Opera Safari (WebKit)
Basic support 14 {{property_prefix("webkit")}} 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

<p>{{APIRef()}}</p>
<div>
 <p>The <code>AudioDestinationNode</code> interface represents the end destination of an audio source in a given context — usually the speakers of your device.</p>
</div>
<p><code>AudioDestinationNode</code> has no output (as it <em>is</em> the output, no more <code>AudioNode</code> can be linked after it in the audio graph) and one input. The amount of channels in the input must be between <code>0</code> and the <code>maxChannelCount</code> value or an exception is raised.</p>
<p>The <code>AudioDestinationNode</code> of a given <code>AudioContext</code> can be retrieved using the {{domxref("AudioContext.destination")}} property.</p>
<ul class="audionodebox">
 <li><dfn>Number of inputs</dfn> <code>1</code></li>
 <li><dfn>Number of outputs</dfn> <code>0</code></li>
 <li><dfn>Channel count mode</dfn> <code>"explicit"</code></li>
 <li><dfn>Channel count</dfn> <code>2</code></li>
 <li><dfn>Channel interpretation</dfn> <code>"speakers"</code></li>
</ul>
<h2 id="Properties">Properties</h2>
<p><em>Inherits properties from its parent, </em><em>{{domxref("AudioNode")}}</em>.</p>
<dl>
 <dt>
  {{domxref("AudioDestinationNode.maxChannelCount")}}</dt>
 <dd>
  Is an <code>unsigned long</code> defining the maximum amount of channels that the physical device can handle.</dd>
</dl>
<h2 id="Methods">Methods</h2>
<p><em>No specific method; inherits methods from its parent, </em><em>{{domxref("AudioNode")}}</em>.</p>
<h2 id="Example">Example</h2>
<p>There is no complex set up for using an <code>AudioDestinationNode</code> — by default, this simply represents the output of the user's system (e.g. their speakers), so you can get it hooked up inside an audio graph using only a few lines of code:</p>
<pre class="brush: js">
var audioCtx = new AudioContext();
var source = audioCtx.createMediaElementSource(myMediaElement);
source.connect(gainNode);
gainNode.connect(audioCtx.destination);</pre>
<p>To see a more complete implementation, check out one of our MDN Web Audio examples, such as <a href="https://mdn.github.io/voice-change-o-matic/">Voice-change-o-matic</a> or <a href="https://mdn.github.io/violent-theremin/">Violent Theremin</a>.</p>
<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', '#the-audiodestinationnode-interface', 'AudioDestinationNode')}}</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>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>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>
</ul>
Revert to this revision