lotus(#1): implement all 4 denoise models; fix gate name + rates
Faithful port of cinny's proven pipeline into the TrackProcessor, closing protocol gap F3 (host offers rnnoise/speex/dtln/deepfilternet; only the first two existed in-source). - Fix real bug: gate worklet registers as "noise-gate" (hyphenated), not "noiseGate" — the gated path would have failed to construct the node. - Per-model sample rate: DTLN runs at 16kHz, others 48kHz (worklets don't resample); verify the context actually got the rate, else fall back. - resume() a suspended context (host postMessage isn't a gesture). - DTLN via dynamic-imported @workadventure helper (bypassUntilReady); DeepFilterNet via dynamic-imported ESM + DeepFilterNet3Core pointed at the self-hosted base. Same-origin base (kept from the C1 fix) makes these dynamic imports safe. - Prefer SIMD rnnoise.wasm with non-SIMD fallback; cache wasm per URL. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
This commit is contained in:
co-authored by
Claude Opus 4.8
parent
29592fbb18
commit
78350a21f4
@@ -53,16 +53,13 @@ function safeAssetBase(raw: string | null): string {
|
||||
export function startLotusDenoise(vm: CallViewModel): () => void {
|
||||
if (lotusParam("lotusDenoise") !== "ml") return () => undefined;
|
||||
|
||||
const requestedModel = lotusParam("lotusModel");
|
||||
// Only RNNoise/Speex are implemented in-source so far. Don't silently
|
||||
// degrade an unsupported model (e.g. the host's dtln/deepfilternet) to
|
||||
// rnnoise — log it so the mismatch is visible.
|
||||
let model: LotusDenoiseConfig["model"] = "rnnoise";
|
||||
if (requestedModel === "speex") model = "speex";
|
||||
else if (requestedModel && requestedModel !== "rnnoise")
|
||||
logger.warn(
|
||||
`[lotus] denoise model "${requestedModel}" not implemented in-source; using rnnoise`,
|
||||
);
|
||||
const requested = lotusParam("lotusModel");
|
||||
const model: LotusDenoiseConfig["model"] =
|
||||
requested === "speex" ||
|
||||
requested === "dtln" ||
|
||||
requested === "deepfilternet"
|
||||
? requested
|
||||
: "rnnoise";
|
||||
|
||||
const rawThreshold = lotusParam("lotusGateThreshold");
|
||||
const config: LotusDenoiseConfig = {
|
||||
|
||||
Reference in New Issue
Block a user