mirror of
https://github.com/open-webui/open-webui.git
synced 2026-11-24 06:20:20 -05:00
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.