Skip to content

fix(audio): preserve speech through echo cancellation - #81

Open
kvnloo wants to merge 5 commits into
TheSmokeDev:mainfrom
kvnloo:fix/linux-echo-cancel
Open

fix(audio): preserve speech through echo cancellation#81
kvnloo wants to merge 5 commits into
TheSmokeDev:mainfrom
kvnloo:fix/linux-echo-cancel

Conversation

@kvnloo

@kvnloo kvnloo commented Sep 2, 2026

Copy link
Copy Markdown

Summary

  • suppress speaker feedback before it reaches server VAD
  • use WebRTC speech detection for fallback barge-in gating
  • route default Linux audio through PulseAudio WebRTC echo cancellation/noise suppression
  • bypass the fallback amplitude gate once upstream AEC is active, preventing quiet words and numeric ranges from being clipped

Root cause

PulseAudio had already removed playback echo, but the application applied a second amplitude/VAD filter and discarded full 100 ms microphone blocks during assistant playback.

Verification

  • pytest -q tests/test_audio.py — 18 passed
  • ruff check . — passed
  • regression proves quiet input survives assistant playback when PulseAudio AEC is active

@kvnloo

kvnloo commented Sep 2, 2026

Copy link
Copy Markdown
Author

Review wave complete. Fixed fallback speech-gate clipping, Pulse route fallback, environment ownership/restoration, concurrent route naming/lifetimes, and WebRTC VAD availability reporting in 934cafc. Verification: 24 audio tests passed; Ruff clean.

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