debug: add TTS send_bytes logging to pipeline
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
parent
5be7f9c078
commit
75083f23aa
|
|
@ -461,15 +461,19 @@ class VoicePipelineTask:
|
|||
return
|
||||
|
||||
# Send audio in WS-sized chunks
|
||||
sent_bytes = 0
|
||||
offset = 0
|
||||
while offset < len(audio_bytes) and not self._cancelled_tts:
|
||||
end = min(offset + _WS_AUDIO_CHUNK, len(audio_bytes))
|
||||
try:
|
||||
await self.websocket.send_bytes(audio_bytes[offset:end])
|
||||
except Exception:
|
||||
sent_bytes += end - offset
|
||||
except Exception as e:
|
||||
print(f"[pipeline] [TTS] send_bytes failed at {offset}/{len(audio_bytes)}: {e}", flush=True)
|
||||
break
|
||||
offset = end
|
||||
await asyncio.sleep(0.005)
|
||||
print(f"[pipeline] [TTS] Sent {sent_bytes}/{len(audio_bytes)} bytes for: \"{text[:20]}\"", flush=True)
|
||||
|
||||
except Exception as exc:
|
||||
logger.error("TTS chunk error: %s", exc)
|
||||
|
|
|
|||
Loading…
Reference in New Issue