This commit is contained in:
Timothy Jaeryang Baek 2026-10-08 18:24:35 +04:00
parent 5729d7ad81
commit b8b3fb9068
2 changed files with 1 additions and 7 deletions

View file

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

View file

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