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-rateAudioParam です。

AudioParam です。

メモ: 返される AudioParam は読み取り専用ですが、それが表す値は読み取り専用ではありません。

BaseAudioContext.createGain() に、AudioContext を用いて GainNode を作成し、その gain プロパティの値を変えることで音声を消音したり消音解除したりするサンプルコードがあります。

仕様書

Specification
Web Audio API
# dom-gainnode-gain

ブラウザーの互換性

Report problems with this compatibility data on GitHub
desktopmobile
Chrome
Edge
Firefox
Opera
Safari
Chrome Android
Firefox for Android
Opera Android
Safari on iOS
Samsung Internet
WebView Android
WebView on iOS
gain

Legend

Tip: you can click/tap on a cell for more information.

Full support
Full support

関連情報