mirror of
https://github.com/open-webui/open-webui.git
synced 2025-12-11 20:05:19 +00:00
refac
This commit is contained in:
parent
48d1e67e79
commit
0eb1246c87
2 changed files with 5 additions and 5 deletions
|
|
@ -468,7 +468,7 @@
|
||||||
}
|
}
|
||||||
|
|
||||||
if ($settings.audio?.tts?.engine === 'browser-kokoro') {
|
if ($settings.audio?.tts?.engine === 'browser-kokoro') {
|
||||||
const blob = await $TTSWorker
|
const url = await $TTSWorker
|
||||||
.generate({
|
.generate({
|
||||||
text: content,
|
text: content,
|
||||||
voice: $settings?.audio?.tts?.voice ?? $config?.audio?.tts?.voice
|
voice: $settings?.audio?.tts?.voice ?? $config?.audio?.tts?.voice
|
||||||
|
|
@ -478,8 +478,8 @@
|
||||||
toast.error(`${error}`);
|
toast.error(`${error}`);
|
||||||
});
|
});
|
||||||
|
|
||||||
if (blob) {
|
if (url) {
|
||||||
audioCache.set(content, new Audio(blob));
|
audioCache.set(content, new Audio(url));
|
||||||
}
|
}
|
||||||
} else if ($config.audio.tts.engine !== '') {
|
} else if ($config.audio.tts.engine !== '') {
|
||||||
const res = await synthesizeOpenAISpeech(
|
const res = await synthesizeOpenAISpeech(
|
||||||
|
|
|
||||||
|
|
@ -292,7 +292,7 @@
|
||||||
loadingSpeech = false;
|
loadingSpeech = false;
|
||||||
});
|
});
|
||||||
|
|
||||||
if (url) {
|
if (url && speaking) {
|
||||||
$audioQueue.enqueue(url);
|
$audioQueue.enqueue(url);
|
||||||
loadingSpeech = false;
|
loadingSpeech = false;
|
||||||
}
|
}
|
||||||
|
|
@ -313,7 +313,7 @@
|
||||||
loadingSpeech = false;
|
loadingSpeech = false;
|
||||||
});
|
});
|
||||||
|
|
||||||
if (res) {
|
if (res && speaking) {
|
||||||
const blob = await res.blob();
|
const blob = await res.blob();
|
||||||
const url = URL.createObjectURL(blob);
|
const url = URL.createObjectURL(blob);
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue