diff options
author | Peter Bengtsson <mail@peterbe.com> | 2020-12-08 14:40:17 -0500 |
---|---|---|
committer | Peter Bengtsson <mail@peterbe.com> | 2020-12-08 14:40:17 -0500 |
commit | 33058f2b292b3a581333bdfb21b8f671898c5060 (patch) | |
tree | 51c3e392513ec574331b2d3f85c394445ea803c6 /files/zh-cn/web/api/gainnode | |
parent | 8b66d724f7caf0157093fb09cfec8fbd0c6ad50a (diff) | |
download | translated-content-33058f2b292b3a581333bdfb21b8f671898c5060.tar.gz translated-content-33058f2b292b3a581333bdfb21b8f671898c5060.tar.bz2 translated-content-33058f2b292b3a581333bdfb21b8f671898c5060.zip |
initial commit
Diffstat (limited to 'files/zh-cn/web/api/gainnode')
-rw-r--r-- | files/zh-cn/web/api/gainnode/gain/index.html | 111 | ||||
-rw-r--r-- | files/zh-cn/web/api/gainnode/index.html | 98 |
2 files changed, 209 insertions, 0 deletions
diff --git a/files/zh-cn/web/api/gainnode/gain/index.html b/files/zh-cn/web/api/gainnode/gain/index.html new file mode 100644 index 0000000000..704c6da76b --- /dev/null +++ b/files/zh-cn/web/api/gainnode/gain/index.html @@ -0,0 +1,111 @@ +--- +title: GainNode.gain +slug: Web/API/GainNode/gain +translation_of: Web/API/GainNode/gain +--- +<p>{{ APIRef("Web Audio API") }}</p> + +<div> +<p>{{ domxref("GainNode") }} 接口的gain属性是一个<a href="/en-US/docs/Web/API/AudioParam#a-rate">a-rate</a> {{domxref("AudioParam")}} ,表示可利用的增益量.</p> +</div> + +<h2 id="语法">语法</h2> + +<pre class="brush: js">var audioCtx = new AudioContext(); +var gainNode = audioCtx.createGain(); +gainNode.gain.value = 0.5; +</pre> + +<h3 id="值">值</h3> + +<p>An {{domxref("AudioParam")}}.</p> + +<div class="note"> +<p><strong>Note</strong>: Though the <code>AudioParam</code> returned is read-only, the value it represents is not.</p> +</div> + +<h2 id="Example">Example</h2> + +<p>{{page("/en-US/docs/Web/API/AudioContext.createGain","Example")}}</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', '#widl-GainNode-gain', 'gain')}}</td> + <td>{{Spec2('Web Audio API')}}</td> + <td> </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>Edge</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>{{CompatVersionUnknown}}</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>Edge</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>{{CompatVersionUnknown}}</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="See_also">See also</h2> + +<ul> + <li><a href="/en-US/docs/Web_Audio_API/Using_Web_Audio_API">Using the Web Audio API</a></li> +</ul> diff --git a/files/zh-cn/web/api/gainnode/index.html b/files/zh-cn/web/api/gainnode/index.html new file mode 100644 index 0000000000..2f18da2097 --- /dev/null +++ b/files/zh-cn/web/api/gainnode/index.html @@ -0,0 +1,98 @@ +--- +title: GainNode +slug: Web/API/GainNode +tags: + - GainNode + - HTML5 音频 + - Web Audio API + - de-zippering +translation_of: Web/API/GainNode +--- +<p>{{ APIRef("Web Audio API") }}</p> + +<div> +<p><strong><code>GainNode</code></strong><strong> </strong>接口表示音量的变化。它是一个{{domxref("AudioNode")}}音频处理模块,在输出前使用给定<em>增益</em>应用到输入。一个 <code>GainNode</code><strong> </strong>总是只有一个输入和一个输出,两者拥有同样数量的声道。</p> + +<p>增益是一个无单位的值,会对所有输入声道的音频进行相应的增加。如果进行了修改,则会立即应用新增益,从而在结果音频中产生奇怪的“咔嗒”声。<font><font>为了防止这种情况发生,请不要直接更改值,而应在</font></font>{{domxref("AudioParam")}}接口<font><font>上使用指数插值方法</font><font>。</font></font></p> +</div> + +<p><img alt="The GainNode is increasing the gain of the output." src="https://mdn.mozillademos.org/files/5085/WebAudioGainNode.png" style="height: 116px; width: 774px;"></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>1</code></td> + </tr> + <tr> + <th scope="row">Channel count mode</th> + <td><code>"max"</code></td> + </tr> + <tr> + <th scope="row">Channel count</th> + <td><code>2</code> (not used in the default count mode)</td> + </tr> + <tr> + <th scope="row">Channel interpretation</th> + <td><code>"speakers"</code></td> + </tr> + </tbody> +</table> + +<h2 id="构造函数">构造函数</h2> + + + +<dl> + <dt>{{domxref("GainNode.GainNode", "GainNode()")}}</dt> + <dd><font><font>创建</font></font><code>GainNode</code><font><font>对象</font><font>的新实例</font><font>。</font><font>不应手动创建增益节点;而应该</font><font>使用</font></font>{{domxref("AudioContext.createGain()")}}方法。</dd> +</dl> + +<h2 id="属性">属性</h2> + +<p><em><font><font>从其父类继承属性</font></font>{{domxref("AudioNode")}}。</em></p> + +<dl> + <dt>{{domxref("GainNode.gain")}} {{readonlyinline}}</dt> +</dl> + +<p><font><font>是一个</font></font><font><font><a href="https://developer.mozilla.org/zh-CN/docs/Web/API/AudioParam#a-rate">a-rate</a></font></font>{{domxref("AudioParam")}}表示应用的增益量。<font><font>必须设置</font></font>{{domxref("AudioParam.value")}}或者使用<code>AudioParam</code>的方法<font><font>改变增益效果。</font></font></p> + +<h2 id="方法">方法</h2> + +<p><em>无指定方法;所有方法继承自父类{{domxref("AudioNode")}}</em>.</p> + +<h2 id="示例">示例</h2> + +<p>{{page("/zh-CN/docs/Web/API/AudioContext.createGain","Example")}}</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-gainnode-interface', 'GainNode')}}</td> + <td>{{Spec2('Web Audio API')}}</td> + <td></td> + </tr> + </tbody> +</table> + +<h2 id="浏览器兼容">浏览器兼容</h2> + +<p>{{Compat("api.GainNode")}}</p> + +<h2 id="参见">参见</h2> + +<ul> + <li><a href="/zh-CN/docs/Web_Audio_API/Using_Web_Audio_API">使用Web音频API</a></li> +</ul> |