--- title: AudioDestinationNode slug: Web/API/AudioDestinationNode translation_of: Web/API/AudioDestinationNode --- <p>{{APIRef("Web Audio API")}}</p> <div> <p><code>AudioDestinationNode</code>接口表示音频图形在特定情况下的最终输出地址 - 通常为扬声器。当使用<code>OfflineAudioContext</code>时为音频记录节点。</p> <p><span style="line-height: 1.5;">AudioDestinationNode没有输出(因为它就是输出,它存在于视频图标中后AudioNode不能被链接),有一个输入。输入信道的数量必须是0至maxChannelCount之间的值或是一个异常。</span></p> </div> <p><code>AudioDestinationNode可以通过</code>{{domxref("AudioContext.destination")}}属性来查看。</p> <table class="properties"> <tbody> <tr> <th scope="row">Number of inputs</th> <td><code>1</code></td> </tr> <tr> <th scope="row">Number of outputs</th> <td><code>0</code></td> </tr> <tr> <th scope="row">Channel count mode</th> <td><code>"explicit"</code></td> </tr> <tr> <th scope="row">Channel count</th> <td><code>2</code></td> </tr> <tr> <th scope="row">Channel interpretation</th> <td><code>"speakers"</code></td> </tr> </tbody> </table> <h2 id="属性">属性</h2> <p><em>从{{domxref("AudioNode")}}继承的属性</em>.</p> <dl> <dt>{{domxref("AudioDestinationNode.maxChannelCount")}}</dt> <dd>以无符长整型返回物理设备可以处理的最大通道数量。</dd> </dl> <h2 id="方法">方法</h2> <p><em>继承</em><em>{{domxref("AudioNode")}}</em>的方法。</p> <h2 id="例子">例子</h2> <p> <code>AudioDestinationNode 不需要使用复杂的设置</code> — 在默认情况下只是简单的代表使用者系统的输出 (例如他们的扬声器),这样你就可以使用几行代码来与内置音频图标挂钩:</p> <pre class="brush: js">var audioCtx = new AudioContext(); var source = audioCtx.createMediaElementSource(myMediaElement); source.connect(gainNode); gainNode.connect(audioCtx.destination);</pre> <p>更多的例子,请查看MDN Web Audio示例,例如<a href="http://mdn.github.io/voice-change-o-matic/">Voice-change-o-matic</a> 或者 <a href="http://mdn.github.io/violent-theremin/">Violent Theremin</a>.</p> <h2 id="标准">标准</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> </td> </tr> </tbody> </table> <h2 id="浏览器支持">浏览器支持</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 {{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 {{property_prefix("webkit")}}</td> <td>25</td> <td>1.2</td> <td>{{CompatNo}}</td> <td>{{CompatNo}}</td> <td>6 {{property_prefix("webkit")}}</td> </tr> </tbody> </table> </div> <h2 id="其他">其他</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>