Fix MSE garbling: copy chunk data to avoid shared ArrayBuffer

This commit is contained in:
russell@unturf.com 2026-01-27 10:17:22 -05:00
parent 092b3c72b2
commit 460bfd6b2a

View file

@ -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