Skip to content

fix(transcription): transcribe mic+system downmix in Both mode#5

Open
farce1 wants to merge 1 commit into
mainfrom
fix/transcribe-system-audio
Open

fix(transcription): transcribe mic+system downmix in Both mode#5
farce1 wants to merge 1 commit into
mainfrom
fix/transcribe-system-audio

Conversation

@farce1

@farce1 farce1 commented Jun 14, 2026

Copy link
Copy Markdown
Owner

What

In the default "Both" capture mode (audio_source defaults to \"both\"), the mixer sent only the microphone to ASR — system/loopback audio was mixed into the OGG recording but never into the transcription stream (audio/mod.rs). Result: in remote/hybrid meetings, every remote participant was missing from the transcript (their audio arrives via system/loopback). In-person meetings were unaffected (the mic catches the room).

Fix

  • New mixer::mix_to_mono(mic, system) — averages the two sources into one mono stream (averaging keeps the signal in range; no clipping), tolerates length mismatch (pads the shorter with silence), and passes the mic through unchanged when there's no system audio.
  • Both mode now sends mix_to_mono(mic, latest_system) to transcription. Mic mode is byte-identical (its latest_system is always empty → mic pass-through); System mode already transcribed loopback.

Diarization still separates speakers from the OGG, so the richer transcript and speaker labels stay coherent.

Verification (TDD)

  • RED→GREEN unit tests for mix_to_mono (5 cases: pass-through, clip-safe average, phase cancellation, shorter-system padding, empty mic).
  • Rust gate locally: clippy --all-targets --all-features -- -D warnings ✅; full cargo test → 5 new tests pass, only the pre-existing model_archive_consts_tests (REPLACE_WITH_ release placeholders) fail, unrelated to this change.

Known limitation (pre-existing, not introduced here)

The mixer pairs each mic chunk with the latest system chunk (crude sync, same as the existing OGG stereo mix) and assumes both sources share a sample rate. Overlapping speech is downmixed (Whisper handles it imperfectly). These are inherited from the current mixing path; this PR strictly adds remote-speaker coverage without changing that behavior.

⚠️ CI will be red — not because of this PR

main is red on three maintainer-only release blockers (SHA256/pubkey REPLACE_WITH_ placeholders, uncommitted vendor/vc_redist.x64.exe, and a separate frontend failure). Verified locally with a temporary untracked vendor placeholder. Do not merge until release prep is complete. Staged Track-A fix from the Handy vs openNotes transcription review; code-only, no new deps.

In the default "Both" capture mode only the microphone was sent to ASR;
system/loopback audio (remote meeting participants) was recorded to the OGG
but never transcribed, so remote speakers were missing from the transcript.

Downmix mic+system to mono for the transcription stream via mix_to_mono so
remote participants appear in the transcript. Averaging keeps the signal in
range (no clipping); Mic mode is unchanged (empty system passes mic through)
and System mode already transcribes loopback.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant