interface AudioWorkletNodeOptions {
/** @default 1 */
numberOfInputs?: number
/** @default 1 */
numberOfOutputs?: number
outputChannelCount?: number[]
parameterData?: any
processorOptions?: any
}
Parameters
options
: An object that is passed as options parameter to the
{{domxref("AudioWorkletNode.AudioWorkletNode", "AudioWorkletNode constructor")}} and
passed through the structured clone algorithm.
Available properties are as follows:
numberOfInputs {{optional_inline}}
: The value to initialize the {{domxref("AudioNode.numberOfInputs", "numberOfInputs")}} property to. Defaults to 1.
numberOfOutputs {{optional_inline}}
: The value to initialize the {{domxref("AudioNode.numberOfOutputs", "numberOfOutputs")}} property to. Defaults to 1.
outputChannelCount {{optional_inline}}
: An array defining the number of channels for each output. For example, outputChannelCount: [n, m] specifies the number of channels in the first output to be n and the second output to be m. The array length must match numberOfOutputs.
parameterData {{optional_inline}}
: An object containing the initial values of custom {{domxref("AudioParam")}} objects on this node (in its {{domxref("AudioWorkletNode.parameters", "parameters")}} property), with key being the name of a custom parameter and value being its initial value.
processorOptions {{optional_inline}}
: Any additional data that can be used for custom initialization of the underlying {{domxref("AudioWorkletProcessor")}}.
Note that there are default values for the first two properties, so even if there are no
options object passed to the {{domxref("AudioWorkletNode.AudioWorkletNode",
"AudioWorkletNode constructor")}}, the options object passed by the node to
the AudioWorkletProcessor constructor will exist and at minimum have
numberOfInputs and numberOfOutputs.
https://developer.mozilla.org/en-US/docs/Web/API/AudioWorkletProcessor/AudioWorkletProcessor