feat(calls): integrate verified DTLN and DFN3 ML noise suppression models
- Verified package layouts and integration paths for @workadventure/noise-suppression (v0.0.4) and deepfilternet3-noise-filter (v1.2.1). - Updated build configuration to correctly copy WASM, TFLite, and ONNX assets. - Integrated DTLN and DeepFilterNet initialization logic into the audio shim. - Enabled all four models (RNNoise, Speex, DTLN, DFN3) in Settings UI.
This commit is contained in:
+30
-5
@@ -54,6 +54,14 @@
|
||||
script: 'speexWorklet.js',
|
||||
wasm: 'speex.wasm',
|
||||
},
|
||||
dtln: {
|
||||
name: 'dtln-processor',
|
||||
script: 'dtlnWorklet.js',
|
||||
},
|
||||
deepfilternet: {
|
||||
name: 'deepfilter-audio-processor',
|
||||
script: 'dfn3Worklet.js',
|
||||
},
|
||||
gate: {
|
||||
name: '@sapphi-red/web-noise-suppressor/noise-gate',
|
||||
script: 'noiseGateWorklet.js',
|
||||
@@ -148,14 +156,31 @@
|
||||
}
|
||||
|
||||
// 2. ML Processor
|
||||
var mlNode = new AudioWorkletNode(ctx, PROCESSORS[MODEL].name, {
|
||||
var mlOptions = {
|
||||
channelCount: 1,
|
||||
channelCountMode: 'explicit',
|
||||
numberOfInputs: 1,
|
||||
numberOfOutputs: 1,
|
||||
outputChannelCount: [1],
|
||||
processorOptions: { maxChannels: 1, wasmBinary: wasmBinary },
|
||||
});
|
||||
processorOptions: { maxChannels: 1 }
|
||||
};
|
||||
|
||||
if (MODEL === 'rnnoise' || MODEL === 'speex') {
|
||||
mlOptions.processorOptions.wasmBinary = wasmBinary;
|
||||
} else if (MODEL === 'dtln') {
|
||||
mlOptions.processorOptions = {
|
||||
wasmUrl: ASSET_BASE + 'litert_wasm_internal.wasm',
|
||||
model1Url: ASSET_BASE + 'model_1.tflite',
|
||||
model2Url: ASSET_BASE + 'model_2.tflite',
|
||||
processorUrl: ASSET_BASE + 'dtlnProcessor.js'
|
||||
};
|
||||
} else if (MODEL === 'deepfilternet') {
|
||||
mlOptions.processorOptions = {
|
||||
wasmModule: wasmBinary,
|
||||
modelBytes: new Uint8Array(wasmBinary),
|
||||
suppressionLevel: 50
|
||||
};
|
||||
}
|
||||
|
||||
var mlNode = new AudioWorkletNode(ctx, PROCESSORS[MODEL].name, mlOptions);
|
||||
head.connect(mlNode);
|
||||
mlNode.connect(dest);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user