From b8b3fb906862ffd9458b7c3d3547f152bbc23139 Mon Sep 17 00:00:00 2001 From: Timothy Jaeryang Baek Date: Thu, 8 Oct 2026 18:24:35 +0400 Subject: [PATCH] refac --- src/lib/utils/realtime-audio.js | 5 +---- src/lib/utils/realtime.ts | 3 --- 2 files changed, 1 insertion(+), 7 deletions(-) diff --git a/src/lib/utils/realtime-audio.js b/src/lib/utils/realtime-audio.js index 7337472487..cf9b88359d 100644 --- a/src/lib/utils/realtime-audio.js +++ b/src/lib/utils/realtime-audio.js @@ -23,10 +23,7 @@ class RealtimeAudioProcessor extends AudioWorkletProcessor { this.enabled = data.enabled; this.captureLength = 0; } else if (data.type === 'audio') { - if (this.queued + data.samples.length > 24000 * 120) { - this.port.postMessage({ type: 'overflow' }); - return; - } + // Speech can arrive faster than playback; release each chunk after it plays. this.received += data.samples.length; this.queue.push({ ...data, offset: 0 }); this.queued += data.samples.length; diff --git a/src/lib/utils/realtime.ts b/src/lib/utils/realtime.ts index e3fc5beae0..efdf6355ee 100644 --- a/src/lib/utils/realtime.ts +++ b/src/lib/utils/realtime.ts @@ -223,9 +223,6 @@ export class RealtimeCall { this.options.change(); } this.flush(); - } else if (data.type === 'overflow') { - this.stopSpeaking(); - this.fail('Voice playback exceeded the 120 second buffer.'); } else if (data.type === 'cleared') { const responses = this.clears.get(data.id); this.clears.delete(data.id);