From 33058f2b292b3a581333bdfb21b8f671898c5060 Mon Sep 17 00:00:00 2001 From: Peter Bengtsson Date: Tue, 8 Dec 2020 14:40:17 -0500 Subject: initial commit --- files/zh-cn/web/api/gainnode/gain/index.html | 111 +++++++++++++++++++++++++++ files/zh-cn/web/api/gainnode/index.html | 98 +++++++++++++++++++++++ 2 files changed, 209 insertions(+) create mode 100644 files/zh-cn/web/api/gainnode/gain/index.html create mode 100644 files/zh-cn/web/api/gainnode/index.html (limited to 'files/zh-cn/web/api/gainnode') 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 +--- +

{{ APIRef("Web Audio API") }}

+ +
+

{{ domxref("GainNode") }} 接口的gain属性是一个a-rate {{domxref("AudioParam")}} ,表示可利用的增益量.

+
+ +

语法

+ +
var audioCtx = new AudioContext();
+var gainNode = audioCtx.createGain();
+gainNode.gain.value = 0.5;
+
+ +

+ +

An {{domxref("AudioParam")}}.

+ +
+

Note: Though the AudioParam returned is read-only, the value it represents is not.

+
+ +

Example

+ +

{{page("/en-US/docs/Web/API/AudioContext.createGain","Example")}}

+ +

Specifications

+ + + + + + + + + + + + + + +
SpecificationStatusComment
{{SpecName('Web Audio API', '#widl-GainNode-gain', 'gain')}}{{Spec2('Web Audio API')}} 
+ +

Browser compatibility

+ +
{{CompatibilityTable}}
+ +
+ + + + + + + + + + + + + + + + + + + + + +
FeatureChromeEdgeFirefox (Gecko)Internet ExplorerOperaSafari (WebKit)
Basic support{{CompatChrome(10.0)}}{{property_prefix("webkit")}}{{CompatVersionUnknown}}{{CompatGeckoDesktop(25.0)}} {{CompatNo}}15.0{{property_prefix("webkit")}}
+ 22 (unprefixed)
6.0{{property_prefix("webkit")}}
+
+ +
+ + + + + + + + + + + + + + + + + + + + + + + + + +
FeatureAndroidEdgeFirefox Mobile (Gecko)Firefox OSIE MobileOpera MobileSafari MobileChrome for Android
Basic support{{CompatUnknown}}{{CompatVersionUnknown}}26.01.2{{CompatUnknown}}{{CompatUnknown}}{{CompatUnknown}}33.0
+
+ +

See also

+ + 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 +--- +

{{ APIRef("Web Audio API") }}

+ +
+

GainNode 接口表示音量的变化。它是一个{{domxref("AudioNode")}}音频处理模块,在输出前使用给定增益应用到输入。一个 GainNode 总是只有一个输入和一个输出,两者拥有同样数量的声道。

+ +

增益是一个无单位的值,会对所有输入声道的音频进行相应的增加。如果进行了修改,则会立即应用新增益,从而在结果音频中产生奇怪的“咔嗒”声。为了防止这种情况发生,请不要直接更改值,而应在{{domxref("AudioParam")}}接口上使用指数插值方法

+
+ +

The GainNode is increasing the gain of the output.

+ + + + + + + + + + + + + + + + + + + + + + + + +
Number of inputs1
Number of outputs1
Channel count mode"max"
Channel count2 (not used in the default count mode)
Channel interpretation"speakers"
+ +

构造函数

+ + + +
+
{{domxref("GainNode.GainNode", "GainNode()")}}
+
创建GainNode对象的新实例不应手动创建增益节点;而应该使用{{domxref("AudioContext.createGain()")}}方法。
+
+ +

属性

+ +

从其父类继承属性{{domxref("AudioNode")}}。

+ +
+
{{domxref("GainNode.gain")}} {{readonlyinline}}
+
+ +

是一个a-rate{{domxref("AudioParam")}}表示应用的增益量。必须设置{{domxref("AudioParam.value")}}或者使用AudioParam的方法改变增益效果。

+ +

方法

+ +

无指定方法;所有方法继承自父类{{domxref("AudioNode")}}.

+ +

示例

+ +

{{page("/zh-CN/docs/Web/API/AudioContext.createGain","Example")}}

+ +

规范

+ + + + + + + + + + + + + + +
SpecificationStatusComment
{{SpecName('Web Audio API', '#the-gainnode-interface', 'GainNode')}}{{Spec2('Web Audio API')}}
+ +

浏览器兼容

+ +

{{Compat("api.GainNode")}}

+ +

参见

+ + -- cgit v1.2.3-54-g00ecf