mirror of
https://github.com/open-webui/open-webui
synced 2025-06-26 18:26:48 +00:00
fix: tts
This commit is contained in:
@@ -98,7 +98,7 @@ export const synthesizeOpenAISpeech = async (
|
||||
token: string = '',
|
||||
speaker: string = 'alloy',
|
||||
text: string = '',
|
||||
model: string = 'tts-1'
|
||||
model?: string
|
||||
) => {
|
||||
let error = null;
|
||||
|
||||
@@ -109,9 +109,9 @@ export const synthesizeOpenAISpeech = async (
|
||||
'Content-Type': 'application/json'
|
||||
},
|
||||
body: JSON.stringify({
|
||||
model: model,
|
||||
input: text,
|
||||
voice: speaker
|
||||
voice: speaker,
|
||||
...(model && { model })
|
||||
})
|
||||
})
|
||||
.then(async (res) => {
|
||||
|
||||
@@ -170,8 +170,7 @@
|
||||
const res = await synthesizeOpenAISpeech(
|
||||
localStorage.token,
|
||||
$settings?.audio?.tts?.voice ?? $config?.audio?.tts?.voice,
|
||||
text,
|
||||
$settings?.audio?.tts?.model ?? $config?.audio?.tts?.model
|
||||
text
|
||||
).catch((error) => {
|
||||
toast.error(error);
|
||||
assistantSpeaking = false;
|
||||
@@ -267,8 +266,7 @@
|
||||
const res = await synthesizeOpenAISpeech(
|
||||
localStorage.token,
|
||||
$settings?.audio?.tts?.voice ?? $config?.audio?.tts?.voice,
|
||||
sentence,
|
||||
$settings?.audio?.tts?.model ?? $config?.audio?.tts?.model
|
||||
sentence
|
||||
).catch((error) => {
|
||||
toast.error(error);
|
||||
|
||||
|
||||
@@ -245,8 +245,7 @@
|
||||
const res = await synthesizeOpenAISpeech(
|
||||
localStorage.token,
|
||||
$settings?.audio?.tts?.voice ?? $config?.audio?.tts?.voice,
|
||||
sentence,
|
||||
$settings?.audio?.tts?.model ?? $config?.audio?.tts?.model
|
||||
sentence
|
||||
).catch((error) => {
|
||||
toast.error(error);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user