AudioWorkletProcessor: parameterDescriptors static property

فهرست فصل‌ها دانلود آرشیوناشر

MDN Web Docs · نسخهٔ df622a2a1c1e · CC BY-SA 2.5 و مجوز جداگانهٔ ناشر برای نمونه‌کد

{{APIRef("Web Audio API")}}

The **parameterDescriptors** static property of an {{domxref("AudioWorkletProcessor")}}-derived class is an iterable of {{domxref("AudioParamDescriptor")}}-based objects.

The property is not a part of the {{domxref("AudioWorkletProcessor")}} interface, but, if defined, it is read by {{domxref("AudioWorkletGlobalScope.registerProcessor", "registerProcessor()")}} to create a list of custom {{domxref("AudioParam")}} objects in the {{domxref("AudioWorkletNode.parameters", "parameters")}} property of the associated {{domxref("AudioWorkletNode")}}. It is never modified by built-in APIs, so it may be defined as a _static getter_.

Defining the property is optional.

Value

An iterable of {{domxref("AudioParamDescriptor")}}-based objects. The properties of these objects are as follows:

  • name
  • : The string which represents the name of the AudioParam. Under this name the AudioParam will be available in the {{domxref("AudioWorkletNode.parameters", "parameters")}} property of the node, and under this name the {{domxref("AudioWorkletProcessor.process")}} method will acquire the calculated values of this AudioParam.
  • automationRate {{optional_inline}}
  • : Either ["a-rate"](/en-US/docs/Web/API/AudioParam#a-rate), or ["k-rate"](/en-US/docs/Web/API/AudioParam#k-rate) string which represents an automation rate of this AudioParam. Defaults to "a-rate".
  • minValue {{optional_inline}}
  • : A float which represents minimum value of the AudioParam. Defaults to -3.4028235e38.
  • maxValue {{optional_inline}}
  • : A float which represents maximum value of the AudioParam. Defaults to 3.4028235e38.
  • defaultValue {{optional_inline}}
  • : A float which represents initial value of the AudioParam. Defaults to 0.

Examples

See [AudioWorkletNode.parameters](/en-US/docs/Web/API/AudioWorkletNode/parameters#examples) for example code showing how to add static parameterDescriptors getter to a custom AudioWorkletProcessor.

Specifications

{{Specifications}}

See also

  • Web Audio API
  • Using the Web Audio API