blob: 473a471124c3dc6c0b7373be982b3394060b3513 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
|
---
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>
{{Compat("api.AudioDestinationNode")}}
<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>
|