aboutsummaryrefslogtreecommitdiff
path: root/files/zh-cn/web/api/audiodestinationnode
diff options
context:
space:
mode:
authorPeter Bengtsson <mail@peterbe.com>2020-12-08 14:40:17 -0500
committerPeter Bengtsson <mail@peterbe.com>2020-12-08 14:40:17 -0500
commit33058f2b292b3a581333bdfb21b8f671898c5060 (patch)
tree51c3e392513ec574331b2d3f85c394445ea803c6 /files/zh-cn/web/api/audiodestinationnode
parent8b66d724f7caf0157093fb09cfec8fbd0c6ad50a (diff)
downloadtranslated-content-33058f2b292b3a581333bdfb21b8f671898c5060.tar.gz
translated-content-33058f2b292b3a581333bdfb21b8f671898c5060.tar.bz2
translated-content-33058f2b292b3a581333bdfb21b8f671898c5060.zip
initial commit
Diffstat (limited to 'files/zh-cn/web/api/audiodestinationnode')
-rw-r--r--files/zh-cn/web/api/audiodestinationnode/index.html141
-rw-r--r--files/zh-cn/web/api/audiodestinationnode/maxchannelcount/index.html113
2 files changed, 254 insertions, 0 deletions
diff --git a/files/zh-cn/web/api/audiodestinationnode/index.html b/files/zh-cn/web/api/audiodestinationnode/index.html
new file mode 100644
index 0000000000..3faf507be0
--- /dev/null
+++ b/files/zh-cn/web/api/audiodestinationnode/index.html
@@ -0,0 +1,141 @@
+---
+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>
diff --git a/files/zh-cn/web/api/audiodestinationnode/maxchannelcount/index.html b/files/zh-cn/web/api/audiodestinationnode/maxchannelcount/index.html
new file mode 100644
index 0000000000..3e3a9ec874
--- /dev/null
+++ b/files/zh-cn/web/api/audiodestinationnode/maxchannelcount/index.html
@@ -0,0 +1,113 @@
+---
+title: AudioDestinationNode.maxChannelCount
+slug: Web/API/AudioDestinationNode/maxChannelCount
+translation_of: Web/API/AudioDestinationNode/maxChannelCount
+---
+<p>{{ APIRef("Web Audio API") }}</p>
+
+<div>
+<p>{{ domxref("AudioDestinationNode") }} 接口的<code>maxchannelCount属性是</code>一个表示物理设备能处理最大通道数的无符号长整型数。</p>
+
+<p> {{domxref("AudioNode.channelCount")}} 属性值只能在 0和这个值 (两端包含)之间。如果 <code>maxChannelCount</code>为 <code>0</code>,例如在 {{domxref("OfflineAudioContext")}}, 表示音频通道不能被改变。</p>
+</div>
+
+<h2 id="语法">语法</h2>
+
+<pre class="brush: js">var audioCtx = new AudioContext();
+var myDestination = audioCtx.destination;
+myDestination.maxChannelCount = 2;
+</pre>
+
+<h3 id="值">值</h3>
+
+<p>一个无符号长整型数</p>
+
+<h2 id="例子">例子</h2>
+
+<p>下面假设了一个简单的音频环境,设置其中 <code>AudioDestinationNode的</code><code>maxChannelCount值为</code> 2:</p>
+
+<pre class="brush: js">var audioCtx = new AudioContext();
+var source = audioCtx.createMediaElementSource(myMediaElement);
+source.connect(gainNode);
+audioCtx.destination.maxChannelCount = 2;
+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', '#widl-AudioDestinationNode-maxChannelCount', 'maxChannelCount')}}</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>{{CompatChrome(10.0)}}{{property_prefix("webkit")}}</td>
+ <td>{{CompatGeckoDesktop(25.0)}} </td>
+ <td>{{CompatNo}}</td>
+ <td>15.0{{property_prefix("webkit")}}<br>
+ 22 (unprefixed)</td>
+ <td>6.0{{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>Firefox Mobile (Gecko)</th>
+ <th>Firefox OS</th>
+ <th>IE Mobile</th>
+ <th>Opera Mobile</th>
+ <th>Safari Mobile</th>
+ <th>Chrome for Android</th>
+ </tr>
+ <tr>
+ <td>Basic support</td>
+ <td>{{CompatUnknown}}</td>
+ <td>26.0</td>
+ <td>1.2</td>
+ <td>{{CompatUnknown}}</td>
+ <td>{{CompatUnknown}}</td>
+ <td>{{CompatUnknown}}</td>
+ <td>33.0</td>
+ </tr>
+ </tbody>
+</table>
+</div>
+
+<h2 id="其他">其他</h2>
+
+<ul>
+ <li><a href="/en-US/docs/Web_Audio_API/Using_Web_Audio_API">Using the Web Audio API</a></li>
+</ul>