Movatterモバイル変換


[0]ホーム

URL:


  1. Web
  2. Web APIs
  3. AudioParamDescriptor

AudioParamDescriptor

TheAudioParamDescriptor dictionary of theWeb Audio API specifies properties forAudioParam objects.

It is used to create customAudioParams on anAudioWorkletNode. If the underlyingAudioWorkletProcessor has aparameterDescriptors static getter, then the returned array of objects based on this dictionary is used internally byAudioWorkletNode constructor to populate itsparameters property accordingly.

Instance properties

name

The string which represents the name of theAudioParam. Under this name theAudioParam will be available in theparameters property of the node, and under this name theAudioWorkletProcessor.process method 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

Afloat which represents minimum value of theAudioParam. Defaults to-3.4028235e38.

maxValueOptional

Afloat which represents maximum value of theAudioParam. Defaults to3.4028235e38.

defaultValueOptional

Afloat which represents initial value of theAudioParam. Defaults to0.

Examples

The code fragment below shows a descriptor of this type being returned by a staticparameterDescriptors method defined in a customAudioWorkletProcessor (this is part of the more complete example inAudioWorkletNode.parameters).

js
// white-noise-processor.jsclass WhiteNoiseProcessor extends AudioWorkletProcessor {  static get parameterDescriptors() {    return [      {        name: "customGain",        defaultValue: 1,        minValue: 0,        maxValue: 1,        automationRate: "a-rate",      },    ];  }  // …}

Specifications

Specification
Web Audio API
# AudioParamDescriptor

See also

Help improve MDN

Learn how to contribute

This page was last modified on byMDN contributors.


[8]ページ先頭

©2009-2025 Movatter.jp