The AudioParamDescriptor
dictionary of the Web Audio API specifies properties for AudioParam
objects.
It is used to create custom AudioParam
s on an AudioWorkletNode
. If the underlying AudioWorkletProcessor
has a parameterDescriptors
static getter, then the returned array of objects based on this dictionary is used internally by AudioWorkletNode
constructor to populate its parameters
property accordingly.
name
The string which represents the name of the AudioParam
. Under this name the AudioParam
will be available in the parameters
property of the node, and under this name the AudioWorkletProcessor.process
method will acquire the calculated values of this AudioParam
.
automationRate
Optional
Either "a-rate"
, or "k-rate"
string which represents an automation rate of this AudioParam
. Defaults to "a-rate"
.
minValue
Optional
A float
which represents minimum value of the AudioParam
. Defaults to -3.4028235e38
.
maxValue
Optional
A float
which represents maximum value of the AudioParam
. Defaults to 3.4028235e38
.
defaultValue
Optional
A float
which represents initial value of the AudioParam
. Defaults to 0
.
The code fragment below shows a descriptor of this type being returned by a static parameterDescriptors
method defined in a custom AudioWorkletProcessor
(this is part of the more complete example in AudioWorkletNode.parameters).
// white-noise-processor.js
class WhiteNoiseProcessor extends AudioWorkletProcessor {
static get parameterDescriptors() {
return [
{
name: "customGain",
defaultValue: 1,
minValue: 0,
maxValue: 1,
automationRate: "a-rate",
},
];
}
// â¦
}
Specifications See also
RetroSearch is an open source project built by @garambo | Open a GitHub Issue
Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo
HTML:
3.2
| Encoding:
UTF-8
| Version:
0.7.3