feat(audio): attach the AI filter per-track after publication (way B, #0054)

Instead of webAudioMix on the room - which would also rewire playback (sink
selection through the AudioContext, LiveKit's Chrome echo workaround) - only the
local microphone track gets an AudioContext, via setAudioContext() right before
setProcessor(). The attach happens in onLocalTrackPublished, so a failing filter
can no longer prevent unmuting: the track is already published by then.

audioCaptureDefaults now never carry a processor key in any state; the
conditional spread only toggles noiseSuppression. A regression test covers the
active case too.

The gate stays closed. A single test client opts in via two localStorage keys
(ai-noise-suppression-dev plus the regular setting); the regular setting alone
stays inert. Four unit tests pin the attach order - setAudioContext before
setProcessor is exactly what v0.5.0 lacked - and the containment of a failing
attach. 77 tests green across the touched suites.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
This commit is contained in:
Thore Cimbal
2026-08-16 12:00:00 +00:00
co-authored by Claude Opus 4.8
parent dcc86431dc
commit df4e5eeb85
8 changed files with 246 additions and 24 deletions
+1 -1
View File
@@ -1,6 +1,6 @@
{
"name": "@sorb/threadnet-call-embedded",
"version": "0.19.2-threadnet.9",
"version": "0.19.2-threadnet.10",
"files": [
"README.md",
"LICENSE-AGPL-3.0",