Creates and initializes an AudioWorkletNode bound to the FluexGL DSP WebAssembly module.
function createAudioWorkletNode<T = any>(
context: AudioContext,
name: AudioWorkletProcessorNames | string,
data: T
): AudioWorkletNode;
Note: this function is defined and exported from
utilities/helpers.ts, but it is not re-exported from the package's top-levelindex.ts. It is not currently reachable asimport { createAudioWorkletNode } from "@fluex/fluexgl-dsp"— it is used internally by every effect class'sinitializeOnAttachment()(e.g.Chorus,LowPassFilter). Documented here for completeness.
The createAudioWorkletNode() function constructs an AudioWorkletNode configured for FluexGL DSP processing.
The function:
sampleRate)numberOfInputs: 1, numberOfOutputs: 1, outputChannelCount: [2])This utility is the primary factory for creating DSP-enabled AudioWorklet nodes and should be used instead of instantiating AudioWorkletNode directly.
context: AudioContext – The AudioContext on which the AudioWorkletNode will be created.name: AudioWorkletProcessorNames | string – The registered AudioWorklet processor name.data: T – Initial parameter data passed to the processor as parameterData, merged with sampleRate.AudioWorkletNode – A fully configured AudioWorklet node ready for DSP processing.ErrorIf the DSP WebAssembly module has not been compiled yet (i.e. initializeDspPipeline() / DspPipeline.initializeDpsPipeline() has not completed successfully), this function throws a plain JavaScript Error with the message:
"Coult not create audio worklet node. WebAssembly has not been compiled yet."
No custom FluexGL-DSP error codes (ErrorCodes) are currently emitted by this function — it does not use the internal debug logger either.