mirror of
https://github.com/open-webui/open-webui.git
synced 2026-10-10 03:27:57 +00:00
refac
This commit is contained in:
parent
5729d7ad81
commit
b8b3fb9068
2 changed files with 1 additions and 7 deletions
|
|
@ -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;
|
||||
|
|
|
|||
|
|
@ -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);
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue