blob: fb6b1b2b4d1c05ad4505d9c016e11c0c3c18ea0c (
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
91
92
93
94
95
96
97
98
99
100
101
102
|
---
title: AudioNodeOptions
slug: conflicting/Web/API/AudioNode
translation_of: Web/API/AudioNodeOptions
original_slug: Web/API/AudioNodeOptions
---
<p>{{APIRef("'Web Audio API'")}}</p>
<p><span class="seoSummary"><a href="/en-US/docs/Web/API/Web_Audio_API">Web Audio API</a> 的 <strong><code>AudioNodeOptions</code></strong> 字典指定了创建新 {{domxref("AudioNode")}} 对象时可使用的选项.</span></p>
<p><code>AudioNodeOptions</code> 继承自不同类型的音频节点构造函数的选项对象. 例如 {{domxref("AnalyserNode.AnalyserNode")}} 或 {{domxref("GainNode.GainNode")}}.</p>
<h2 id="语法">语法</h2>
<pre class="syntaxbox">var audioNodeOptions = {
"channelCount" : 2,
"channelCountMode" : "max",
"channelInterpretation" : "discrete"
}</pre>
<h3 id="参数">参数</h3>
<dl>
<dt><em>channelCount</em> {{optional_inline}}</dt>
<dd>Represents an integer used to determine how many channels are used when <a href="/en-US/docs/Web/API/Web_Audio_API/Basic_concepts_behind_Web_Audio_API#Up-mixing_and_down-mixing">up-mixing and down-mixing</a> connections to any inputs to the node. (See {{domxref("AudioNode.channelCount")}} for more information.) Its usage and precise definition depend on the value of {{domxref("AudioNodeOptions.channelCountMode")}}.</dd>
<dt><em>channelCount</em>Mode {{optional_inline}}</dt>
<dd>Represents an enumerated value describing the way channels must be matched between the node's inputs and outputs. (See {{domxref("AudioNode.channelCountMode")}} for more information including default values.)</dd>
<dt><em>channelInterpretation</em> {{optional_inline}}</dt>
<dd>Represents an enumerated value describing the meaning of the channels. This interpretation will define how audio <a href="/en-US/docs/Web/API/Web_Audio_API/Basic_concepts_behind_Web_Audio_API#Up-mixing_and_down-mixing">up-mixing and down-mixing</a> will happen.<br>
The possible values are <code>"speakers"</code> or <code>"discrete"</code>. (See {{domxref("AudioNode.channelCountMode")}} for more information including default values.)</dd>
</dl>
<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','#audionodeoptions','AudioNodeOptions')}}</td>
<td>{{Spec2('Web Audio API')}}</td>
<td>Initial definition.</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(55.0)}}</td>
<td>{{CompatGeckoDesktop(53)}}</td>
<td>{{CompatUnknown}}</td>
<td>{{CompatOpera(42)}}</td>
<td>{{CompatUnknown}}</td>
</tr>
</tbody>
</table>
</div>
<div id="compat-mobile">
<table class="compat-table">
<tbody>
<tr>
<th>Feature</th>
<th>Android</th>
<th>Android Webview</th>
<th>Firefox Mobile (Gecko)</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>{{CompatNo}}</td>
<td>{{CompatChrome(55.0)}}</td>
<td>{{CompatGeckoMobile(53)}}</td>
<td>{{CompatUnknown}}</td>
<td>{{CompatOperaMobile(42)}}</td>
<td>{{CompatUnknown}}</td>
<td>{{CompatChrome(55.0)}}</td>
</tr>
</tbody>
</table>
</div>
|