AudioParam.defaultValue

The defaultValue property of the AudioParam interface represents the initial value of the attributes as defined by the specific AudioNode creating the AudioParam.

Syntax

js;highlight[5]
var gainNode = audioCtx.createGain();
var gainDefault = gainNode.gain.defaultValue; //'gain' is the AudioParam

Value

A float.

Example

js;highlight[5]
var AudioContext = window.AudioContext || window.webkitAudioContext;
var audioCtx = new AudioContext();

var gainNode = audioCtx.createGain();
var gainDefault = gainNode.gain.defaultValue;

Specifications

Specification Status Comment
Web Audio API
The definition of 'defaultValue' in that specification.
Working Draft  

Browser compatibility

Feature Chrome Firefox (Gecko) Internet Explorer Opera Safari (WebKit)
Basic support 14 webkit 23 Not supported 15 webkit
22 (unprefixed)
6 webkit
Feature Android Chrome Firefox Mobile (Gecko) Firefox OS IE Phone Opera Mobile Safari Mobile
Basic support Not supported 28 webkit 25 1.2 Not supported Not supported webkit

See also

License

© 2016 Mozilla Contributors
Licensed under the Creative Commons Attribution-ShareAlike License v2.5 or later.
https://developer.mozilla.org/en-us/docs/web/api/audioparam/defaultvalue

API AudioParam defaultValue Property Reference Référence Web Audio API