Fix choppy/distorted audio to live caller
- Mute host mic forwarding while TTS is streaming to prevent interleaving both audio sources into the same playback buffer - Replace nearest-neighbor downsampling with box-filter averaging on both server (host mic) and browser (caller mic) for anti-aliased resampling Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
@@ -880,6 +880,9 @@ async def _host_audio_sender():
|
||||
"""Persistent task that drains audio queue and sends to callers"""
|
||||
while True:
|
||||
pcm_bytes = await _host_audio_queue.get()
|
||||
# Skip host mic audio while TTS is streaming to avoid interleaving
|
||||
if caller_service.streaming_tts:
|
||||
continue
|
||||
for caller_id in list(caller_service.active_calls.keys()):
|
||||
try:
|
||||
await caller_service.send_audio_to_caller(caller_id, pcm_bytes, 16000)
|
||||
|
||||
Reference in New Issue
Block a user