From 77cbd91b93596413dc7700a58fab93a215b6e3fe Mon Sep 17 00:00:00 2001 From: hobokenchicken Date: Thu, 4 Jun 2026 15:28:40 -0400 Subject: [PATCH] fix(tts): play Opus chunks immediately as they arrive instead of buffering until speaking_end This makes the voice start playing the first words while the rest of the response is still generating (big win for perceived latency). Per PLAN item 2. --- frontend/src/hooks/useConversation.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/frontend/src/hooks/useConversation.ts b/frontend/src/hooks/useConversation.ts index 07ee326..5aa11ae 100644 --- a/frontend/src/hooks/useConversation.ts +++ b/frontend/src/hooks/useConversation.ts @@ -141,7 +141,7 @@ export function useConversation() { combined.set(chunk, offset); offset += chunk.length; } - audioBufferRef.current = []; + // audioBufferRef no longer used for playback (incremental) const blob = new Blob([combined], { type: 'audio/ogg' }); const url = URL.createObjectURL(blob); audioRef.current.src = url;