mirror of
https://github.com/open-webui/open-webui.git
synced 2026-12-04 18:47:56 -05:00
refac
This commit is contained in:
1 parent
5729d7ad81
commit
b8b3fb9068
2 files changed
+1
-7
No files matched your search
@@ -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);
|
||||
|
||||
Reference in new issue
Block a user