From 7da8653e71cda807609d9ec64912cd319c0d6ccf Mon Sep 17 00:00:00 2001 From: G30 <50341825+silentoplayz@users.noreply.github.com> Date: Thu, 15 Oct 2026 19:02:28 -0400 Subject: [PATCH] fix: read aloud no longer stops after the first sentence when speech is slow (#32484) speak() synthesizes one sentence at a time and enqueues each clip as it arrives. When a clip finishes before the next one is ready, the audio queue reports 'empty-queue', and the onStopped handler set speaking to false. The loop only enqueues while speaking is true, so every later clip was synthesized and then dropped, and the speaker button went back to idle. Ignore 'empty-queue' while the synthesis loop is still running; playback resumes on the next enqueue, and the queue's 'empty-queue' after the last clip still ends playback as before. --- src/lib/components/chat/Messages/ResponseMessage.svelte | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/lib/components/chat/Messages/ResponseMessage.svelte b/src/lib/components/chat/Messages/ResponseMessage.svelte index 2138d2e9af..91606fc396 100644 --- a/src/lib/components/chat/Messages/ResponseMessage.svelte +++ b/src/lib/components/chat/Messages/ResponseMessage.svelte @@ -292,7 +292,10 @@ } else { $audioQueue.setId(`${message.id}`); $audioQueue.setPlaybackRate($settings.audio?.tts?.playbackRate ?? 1); + let synthesizing = true; $audioQueue.onStopped = ({ event }) => { + if (event === 'empty-queue' && synthesizing) return; + speaking = false; speakingIdx = undefined; @@ -371,6 +374,8 @@ } } } + + synthesizing = false; } };