AudioParamDescriptor
The AudioParamDescriptor dictionary of the Web Audio API specifies properties for AudioParam objects.
It is used to create custom AudioParams 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.
Properties
name-
The
DOMStringwhich represents the name of theAudioParam. Under this name theAudioParamwill be available in theparametersproperty of the node, and under this name theAudioWorkletProcessor.processmethod will acquire the calculated values of thisAudioParam. -
automationRateOptional -
Either
"a-rate", or"k-rate"string which represents an automation rate of thisAudioParam. Defaults to"a-rate". -
minValueOptional -
A
floatwhich represents minimum value of theAudioParam. Defaults to-3.4028235e38. -
maxValueOptional -
A
floatwhich represents maximum value of theAudioParam. Defaults to3.4028235e38. -
defaultValueOptional -
A
floatwhich represents initial value of theAudioParam. Defaults to0.
Examples
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
No specification data found for api.AudioParamDescriptor.
Check for problems with this page or contribute a missing spec_url to mdn/browser-compat-data. Also make sure the specification is included in w3c/browser-specs.
Browser compatibility
No compatibility data found for api.AudioParamDescriptor.
Check for problems with this page or contribute missing data to mdn/browser-compat-data.
See also
© 2005–2021 MDN contributors.
Licensed under the Creative Commons Attribution-ShareAlike License v2.5 or later.
https://developer.mozilla.org/en-US/docs/Web/API/AudioParamDescriptor