The AudioWorkletNode() constructor creates a new AudioWorkletNode object, which represents an AudioNode that uses a JavaScript function to perform custom audio processing.


var node = new AudioWorkletNode(context, name);
var node = new AudioWorkletNode(context, name, options);


The BaseAudioContext instance this node will be associated with.
A string, which represents the name of the AudioWorkletProcessor this node will be based on. A processor with the provided name must first be registered using the AudioWorkletGlobalScope.registerProcessor() method.
options Optional
An object based on the AudioWorkletNodeOptions dictionary, which contains zero or more optional properties to configure the new node. The result of the structured clone algorithm applied to the object is also internally passed into the associated AudioWorkletProcessor() constructor — this allows custom initialization of an underlying user-defined AudioWorkletProcessor. Available properties are as follows:
numberOfInputs Optional
The value to initialize the numberOfInputs property to. Defaults to 1.
numberOfOutputs Optional
The value to initialize the numberOfOutputs property to. Defaults to 1.
outputChannelCount Optional
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
An object containing the initial values of custom AudioParam objects on this node (in its parameters property), with key being the name of a custom parameter and value being its initial value.
processorOptions Optional
Any additional data that can be used for custom initialization of the underlying AudioWorkletProcessor.

Return value

The newly constructed AudioWorkletNode instance.


The specified options.outputChannelCount is 0 or larger than the current implementation supports.
The length of options.outputChannelCount array does not match options.numberOfOutputs.


For a complete example demonstrating user-defined audio processing, see the AudioWorkletNode page.


Specification Status Comment
Web Audio API
The definition of 'AudioWorkletNode()' in that specification.
Working Draft Initial definition.

Browser compatibility

Update compatibility data on GitHub
ChromeEdgeFirefoxInternet ExplorerOperaSafariAndroid webviewChrome for AndroidFirefox for AndroidOpera for AndroidSafari on iOSSamsung Internet
AudioWorkletNode() constructorChrome Full support 66Edge Full support 79Firefox Full support 76IE No support NoOpera ? Safari No support NoWebView Android Full support 66Chrome Android Full support 66Firefox Android Full support 79Opera Android ? Safari iOS No support NoSamsung Internet Android Full support 9.0


Full support  
Full support
No support  
No support
Compatibility unknown  
Compatibility unknown

See also