AudioParam: defaultValue property
MDN Web Docs · نسخهٔ df622a2a1c1e · CC BY-SA 2.5 و مجوز جداگانهٔ ناشر برای نمونهکد
{{APIRef("Web Audio API")}}
The **defaultValue** read-only property of the {{ domxref("AudioParam") }} interface represents the initial value of the attributes as defined by the specific {{domxref("AudioNode")}} creating the AudioParam.
Value
A floating-point {{jsxref("Number")}}.
Examples
js
const audioCtx = new AudioContext();
const gainNode = audioCtx.createGain();
const defaultVal = gainNode.gain.defaultValue;
console.log(defaultVal); // 1
console.log(defaultVal === gainNode.gain.value); // trueSpecifications
{{Specifications}}
Browser compatibility
{{Compat}}
See also
- Using the Web Audio API