DspPipelineRepresents the digital signal processing (DSP) pipeline responsible for initializing WebAssembly modules, AudioWorklet processors, and resolving audio output devices.
import { DspPipeline } from "@fluex/fluexgl-dsp";
const pipeline = new DspPipeline({
pathToWasm: "/dsp/dsp.wasm",
pathToWorklet: "/dsp/processor.worklet.js",
options: { /* DSP global options */ }
});
await pipeline.init();
const device = await pipeline.resolveDefaultAudioOutputDevice();
Constructs a new DSP pipeline using the provided initialization options (WASM path, worklet path, and global DSP options).
new DspPipeline({ pathToWasm, pathToWorklet, options }: DspPipelineInitializationOptions): DspPipeline;
options: DspPipelineInitializationOptions - Initialization object containing pathToWasm, pathToWorklet, and optional DSP configuration.pathToWasm: string | nullpathToWorklet: string | nullid: stringhasInitialized: booleaninit(): Promise<boolean>Convenience wrapper around initializeDpsPipeline().
No arguments
Promise<boolean>initializeDpsPipeline(): Promise<boolean>No arguments
Promise<boolean>resolveDefaultAudioOutputDevice(): Promise<AudioDevice | null>No arguments
Promise<AudioDevice | null> - The default AudioDevice instance, or null when no output device is found or initialization is missing.The default device is the "default" entry of enumerateDevices(), or the first output device in browsers without one (such as Firefox). See findDefaultAudioDevice(). The output device can be switched later with audioDevice.setOutputDevice().
tellMeWhatTheFuckThisWholeLibraryActuallyDoes(): stringNo arguments
stringThis class does not emit custom events.
This class does not define public getters or setters.
const pipeline = new DspPipeline({ pathToWasm, pathToWorklet, options: {} });
const ok = await pipeline.initializeDpsPipeline();
if (!ok) throw new Error("DSP pipeline init failed");
const device = await pipeline.resolveDefaultAudioOutputDevice();
if (!device) throw new Error("No default audio output device");
const pipeline = new DspPipeline({ pathToWasm, pathToWorklet, options: {} });
await pipeline.init();