From 460bfd6b2a0d9c6f5de059ba0d546ebe9df4f0f2 Mon Sep 17 00:00:00 2001 From: "russell@unturf.com" Date: Tue, 27 Jan 2026 10:17:22 -0500 Subject: [PATCH] Fix MSE garbling: copy chunk data to avoid shared ArrayBuffer --- public/src/tts.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/public/src/tts.js b/public/src/tts.js index 2dcd195..71e4032 100644 --- a/public/src/tts.js +++ b/public/src/tts.js @@ -240,8 +240,8 @@ export async function speakTextStreaming(text, voice = "alloy", rate = 0.9, mode chunks.push(value); totalBytes += value.byteLength; - // Queue the chunk for appending - appendQueue.push(value.buffer); + // Queue the chunk for appending (use slice to avoid shared ArrayBuffer issues) + appendQueue.push(value.slice().buffer); processQueue(); // Auto-play once we have some data