AudioWorkletNode()
构造函数创建新
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);
context
BaseAudioContext
instance this node will be associated with.
名称
AudioWorkletProcessor
this node will be based on. A processor with the provided name must first be registered using the
AudioWorkletGlobalScope.registerProcessor()
方法。
选项
可选
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
可选
numberOfInputs
property to. Defaults to 1.
numberOfOutputs
可选
numberOfOutputs
property to. Defaults to 1.
outputChannelCount
可选
numberOfOutputs
.
parameterData
可选
AudioParam
objects on this node (in its
参数
property), with
key
being the name of a custom parameter and
value
being its initial value.
processorOptions
可选
AudioWorkletProcessor
.
The newly constructed
AudioWorkletNode
实例。
NotSupportedError
options.outputChannelCount
is
0
or larger than the current implementation supports.
IndexSizeError
options.outputChannelCount
array does not match
options.numberOfOutputs
.
For a complete example demonstrating user-defined audio processing, see the
AudioWorkletNode
页面。
| 规范 | 状态 | 注释 |
|---|---|---|
|
Web 音频 API
The definition of 'AudioWorkletNode()' in that specification. |
工作草案 | 初始定义。 |
| 桌面 | 移动 | |||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|
AudioWorkletNode()
构造函数
|
Chrome 66 | Edge 79 | Firefox 76 | IE 不支持 No | Opera ? | Safari 不支持 No | WebView Android 66 | Chrome Android 66 | Firefox Android 不支持 No | Opera Android ? | Safari iOS 不支持 No | Samsung Internet Android 9.0 |
完整支持
不支持
兼容性未知
AudioWorkletNode
AudioWorkletNode()
AnalyserNode
AudioBuffer
AudioBufferSourceNode
AudioContext
AudioContextOptions
AudioDestinationNode
AudioListener
AudioNode
AudioNodeOptions
AudioParam
AudioProcessingEvent
AudioScheduledSourceNode
AudioWorklet
AudioWorkletGlobalScope
AudioWorkletProcessor
BaseAudioContext
BiquadFilterNode
ChannelMergerNode
ChannelSplitterNode
ConstantSourceNode
ConvolverNode
DelayNode
DynamicsCompressorNode
GainNode
IIRFilterNode
MediaElementAudioSourceNode
MediaStreamAudioDestinationNode
MediaStreamAudioSourceNode
OfflineAudioCompletionEvent
OfflineAudioContext
OscillatorNode
PannerNode
PeriodicWave
StereoPannerNode
WaveShaperNode