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.
This commit is contained in:
2026-06-04 15:28:40 -04:00
parent 0e74a16b40
commit 77cbd91b93
+1 -1
View File
@@ -141,7 +141,7 @@ export function useConversation() {
combined.set(chunk, offset); combined.set(chunk, offset);
offset += chunk.length; offset += chunk.length;
} }
audioBufferRef.current = []; // audioBufferRef no longer used for playback (incremental)
const blob = new Blob([combined], { type: 'audio/ogg' }); const blob = new Blob([combined], { type: 'audio/ogg' });
const url = URL.createObjectURL(blob); const url = URL.createObjectURL(blob);
audioRef.current.src = url; audioRef.current.src = url;