forked from mdn/content
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathindex.html
51 lines (38 loc) · 1.25 KB
/
index.html
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
---
title: AudioParam.defaultValue
slug: Web/API/AudioParam/defaultValue
tags:
- API
- AudioParam
- Property
- Reference
- Web Audio API
- defaultValue
browser-compat: api.AudioParam.defaultValue
---
<p>{{APIRef("Web Audio API")}}</p>
<p>The <strong><code>defaultValue</code></strong>
read-only property of the {{ domxref("AudioParam") }} interface represents the initial
value of the attributes as defined by the specific {{domxref("AudioNode")}} creating
the <code>AudioParam</code>.</p>
<h2 id="Syntax">Syntax</h2>
<pre
class="brush: js">var <em>defaultVal</em> = <em>audioParam</em>.defaultValue;</pre>
<h3 id="Value">Value</h3>
<p>A floating-point {{jsxref("Number")}}.</p>
<h2 id="Example">Example</h2>
<pre class="brush: js;">const audioCtx = new AudioContext();
const gainNode = audioCtx.createGain();
const defaultVal = gainNode.gain.defaultValue;
console.log(defaultVal); // 1
console.log(defaultVal === gainNode.gain.value); // true
</pre>
<h2 id="Specifications">Specifications</h2>
{{Specifications}}
<h2 id="Browser_compatibility">Browser compatibility</h2>
<p>{{Compat}}</p>
<h2 id="See_also">See also</h2>
<ul>
<li><a href="/en-US/docs/Web/API/Web_Audio_API/Using_Web_Audio_API">Using the Web Audio API</a>
</li>
</ul>