Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

sync with english version for GainNode.gain #8226

Merged
merged 2 commits into from
Sep 3, 2022
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
30 changes: 11 additions & 19 deletions files/zh-cn/web/api/gainnode/gain/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,34 +4,26 @@ slug: Web/API/GainNode/gain
---
{{ APIRef("Web Audio API") }}

{{ domxref("GainNode") }} 接口的 gain 属性是一个[a-rate](/zh-CN/docs/Web/API/AudioParam#a-rate) {{domxref("AudioParam")}} ,表示可利用的增益量
{{ domxref("GainNode") }} 接口的 `gain` 属性是一个 [a-rate](/zh-CN/docs/Web/API/AudioParam#a-rate) {{domxref("AudioParam")}},表示要应用的增益量

## 语法
##

```js
var audioCtx = new AudioContext();
var gainNode = audioCtx.createGain();
gainNode.gain.value = 0.5;
```
一个 {{domxref("AudioParam")}}。

### 值
> **备注:** 虽然 `AudioParam` 属性是只读的,但其返回的值不是。

An {{domxref("AudioParam")}}.
## 示例

> **备注:** Though the `AudioParam` returned is read-only, the value it represents is not.
参见 [`BaseAudioContext.createGain()`](/zh-CN/docs/Web/API/BaseAudioContext/createGain#examples) 以获取示例代码,示例代码展示了如何使用 `AudioContext` 来创建 `GainNode`,并通过修改其 gain 属性值以静音或取消静音。
yin1999 marked this conversation as resolved.
Show resolved Hide resolved

## Example

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

## Specifications
## 规范

{{Specifications}}

## Browser compatibility
## 浏览器兼容性

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

## See also
## 参见

- [Using the Web Audio API](/zh-CN/docs/Web_Audio_API/Using_Web_Audio_API)
- [使用 Web Audio API](/zh-CN/docs/Web/API/Web_Audio_API/Using_Web_Audio_API)