GainNode.gain
Baseline Widely available
This feature is well established and works across many devices and browser versions. It’s been available across browsers since April 2021.
GainNode
接口的 gain
属性是一个 a-rate AudioParam
,表示要应用的增益量。
值
一个 AudioParam
。
备注:
虽然 AudioParam
属性是只读的,但其返回的值不是。
示例
参见 BaseAudioContext.createGain()
以获取示例代码,示例代码展示了如何使用 AudioContext
来创建 GainNode
,并通过修改其 gain 属性值以静音或取消静音。
规范
Specification |
---|
Web Audio API # dom-gainnode-gain |
浏览器兼容性
Report problems with this compatibility data on GitHubdesktop | mobile | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|
gain |
Legend
Tip: you can click/tap on a cell for more information.
- Full support
- Full support
The compatibility table on this page is generated from structured data. If you'd like to contribute to the data, please check out https://github.com/mdn/browser-compat-data and send us a pull request.