diff --git a/src/lib/components/chat/Messages/ResponseMessage.svelte b/src/lib/components/chat/Messages/ResponseMessage.svelte index 10f1582b0..1d8a4fa54 100644 --- a/src/lib/components/chat/Messages/ResponseMessage.svelte +++ b/src/lib/components/chat/Messages/ResponseMessage.svelte @@ -148,7 +148,7 @@ } else { speaking = true; - if ($settings?.voice?.TTSEngine === 'openai') { + if ($settings?.audio?.TTSEngine === 'openai') { loadingSpeech = true; const sentences = extractSentences(message.content).reduce((mergedTexts, currentText) => { @@ -179,7 +179,7 @@ for (const [idx, sentence] of sentences.entries()) { const res = await synthesizeOpenAISpeech( localStorage.token, - $settings?.voice?.speaker, + $settings?.audio?.speaker, sentence ).catch((error) => { toast.error(error); @@ -204,7 +204,7 @@ clearInterval(getVoicesLoop); const voice = - voices?.filter((v) => v.name === $settings?.voice?.speaker)?.at(0) ?? undefined; + voices?.filter((v) => v.name === $settings?.audio?.speaker)?.at(0) ?? undefined; const speak = new SpeechSynthesisUtterance(message.content); diff --git a/src/lib/components/chat/Settings/Voice.svelte b/src/lib/components/chat/Settings/Audio.svelte similarity index 97% rename from src/lib/components/chat/Settings/Voice.svelte rename to src/lib/components/chat/Settings/Audio.svelte index 5867b917e..289ec0bb0 100644 --- a/src/lib/components/chat/Settings/Voice.svelte +++ b/src/lib/components/chat/Settings/Audio.svelte @@ -5,7 +5,7 @@ export let saveSettings: Function; - // Voice + // Audio let STTEngines = ['', 'openai']; let STTEngine = ''; @@ -74,9 +74,9 @@ speechAutoSend = settings.speechAutoSend ?? false; responseAutoPlayback = settings.responseAutoPlayback ?? false; - STTEngine = settings?.voice?.STTEngine ?? ''; - TTSEngine = settings?.voice?.TTSEngine ?? ''; - speaker = settings?.voice?.speaker ?? ''; + STTEngine = settings?.audio?.STTEngine ?? ''; + TTSEngine = settings?.audio?.TTSEngine ?? ''; + speaker = settings?.audio?.speaker ?? ''; if (TTSEngine === 'openai') { getOpenAIVoices(); @@ -90,7 +90,7 @@ class="flex flex-col h-full justify-between space-y-3 text-sm" on:submit|preventDefault={() => { saveSettings({ - voice: { + audio: { STTEngine: STTEngine !== '' ? STTEngine : undefined, TTSEngine: TTSEngine !== '' ? TTSEngine : undefined, speaker: speaker !== '' ? speaker : undefined diff --git a/src/lib/components/chat/SettingsModal.svelte b/src/lib/components/chat/SettingsModal.svelte index 83b2e3076..3e5cf0669 100644 --- a/src/lib/components/chat/SettingsModal.svelte +++ b/src/lib/components/chat/SettingsModal.svelte @@ -13,7 +13,7 @@ import General from './Settings/General.svelte'; import External from './Settings/External.svelte'; import Interface from './Settings/Interface.svelte'; - import Voice from './Settings/Voice.svelte'; + import Audio from './Settings/Audio.svelte'; import Chats from './Settings/Chats.svelte'; export let show = false; @@ -206,11 +206,11 @@