[Backend] Enable VAD by default and drop the noise floor to -45 dB #323
Loading…
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Severity: HIGH. Found in the August 2026 session lifecycle review (#319). This is a required companion to the wall-clock capture fix — shipping that fix without this is a regression.
Why this is coupled to the capture fix
VAD is currently off in production: there is no
vad_configrow inapp_settings, soVAD_DEFAULT_ENABLED = Falseapplies (webapp/backend/app/services/settings_service.py:136).That is survivable today only because the capture bug deletes all silence before the audio ever reaches Whisper. Once capture is corrected, every track runs the full wall-clock length and three things change at once:
The VAD pre-pass addresses all three: it cuts each track into speech spans, transcribes each span, and re-anchors timestamps by adding the span's own start offset. Its arithmetic is the most rigorous code in the transcription layer — spans, offsets, trailing-silence and fully-silent cases are all correct and covered by
tests/test_vad_trim.py.The noise floor is wrong for this input
VAD_DEFAULT_NOISE_FLOOR_DB = -30(settings_service.py:138) is aggressive.silencedetectmarks anything below -30 dBFS for at leastmin_silence_ms(default 2000) as silence, so a soft-spoken player, a whispered in-character aside, or an un-normalised quiet mic can be cut and never transcribed — silently, since only aggregatekept_secondsis logged.Discord per-user tracks are digitally silent (-inf dB) when that user is not transmitting, so a much lower floor loses nothing real. Set the default to -45 dB.
Note that cutting quiet speech would be a new way to lose data, so this is the one change in the hotfix that should be validated against a real recording before it goes to production.
Acceptance criteria
VAD_DEFAULT_ENABLED = TrueVAD_DEFAULT_NOISE_FLOOR_DB = -45vad_configrow pick up the new defaults; an explicit row still winsShipped — closing as part of a v3.11.5 bookkeeping sweep.
Both halves are in
webapp/backend/app/services/settings_service.py:get_vad_config's docstring carries the reasoning — with per-speaker tracks correctly spanning the whole session, each one is mostly silence, which is Whisper's documented worst case for hallucinating phantom speech.Worth noting it has been load-bearing since:
transcribe_session's #342 rework leaned on VAD already being the default, since the VAD path had always sent one file per request and so was already free of the echo-based attribution join.audio_service.py:1012also warns when the floor looks like it is clipping quiet speech, which is the follow-through this issue's floor change needed.