GainNode: gain property

فهرست فصل‌ها دانلود آرشیوناشر

MDN Web Docs · نسخهٔ df622a2a1c1e · CC BY-SA 2.5 و مجوز جداگانهٔ ناشر برای نمونه‌کد

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

The gain property of the {{ domxref("GainNode") }} interface is an a-rate {{domxref("AudioParam")}} representing the amount of gain to apply.

Value

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

توجه: Though the AudioParam returned is read-only, the value it represents is not.

Examples

See [BaseAudioContext.createGain()](/en-US/docs/Web/API/BaseAudioContext/createGain#examples) for example code showing how to use an AudioContext to create a GainNode, which is then used to mute and unmute the audio by changing the gain property value.

Specifications

{{Specifications}}

Browser compatibility

{{Compat}}

See also

  • Using the Web Audio API