diff --git a/src/lib/components/admin/Settings/Audio.svelte b/src/lib/components/admin/Settings/Audio.svelte index 7d7f24a702..c8934c36d2 100644 --- a/src/lib/components/admin/Settings/Audio.svelte +++ b/src/lib/components/admin/Settings/Audio.svelte @@ -234,7 +234,7 @@ bind:value={TTS_VOICE} > {$i18n.t('Default')} - {#each voices.filter((v) => nonLocalVoices || v.localService === true) as voice} + {#each voices as voice} - - - {$i18n.t('Allow non-local voices')} - - - - - - {:else if TTS_ENGINE === 'openai'} diff --git a/src/lib/components/chat/MessageInput.svelte b/src/lib/components/chat/MessageInput.svelte index aaefc85308..c26abfffe5 100644 --- a/src/lib/components/chat/MessageInput.svelte +++ b/src/lib/components/chat/MessageInput.svelte @@ -913,7 +913,14 @@ try { await navigator.mediaDevices.getUserMedia({ audio: true, video: true }); // If the user grants the permission, proceed to show the call overlay - showCallOverlay.set(true); + + if ($config.audio.stt.engine !== 'web') { + showCallOverlay.set(true); + } else { + toast.error( + $i18n.t('Call feature is not supported when using Web STT engine') + ); + } } catch (err) { // If the user denies the permission or an error occurs, show an error message toast.error($i18n.t('Permission denied when accessing media devices')); diff --git a/src/lib/components/chat/MessageInput/CallOverlay.svelte b/src/lib/components/chat/MessageInput/CallOverlay.svelte index 15c649306a..51dae5a7cd 100644 --- a/src/lib/components/chat/MessageInput/CallOverlay.svelte +++ b/src/lib/components/chat/MessageInput/CallOverlay.svelte @@ -221,11 +221,12 @@ ) ?.at(0) ?? undefined; - console.log($settings?.audio?.tts?.voice ?? $config?.audio?.tts?.voice); - console.log(voices); - currentUtterance = new SpeechSynthesisUtterance(content); - currentUtterance.voice = voice; + + if (voice) { + currentUtterance.voice = voice; + } + speechSynthesis.speak(currentUtterance); } }, 100); diff --git a/src/lib/components/chat/Messages/ResponseMessage.svelte b/src/lib/components/chat/Messages/ResponseMessage.svelte index 860369b640..11eaa754dd 100644 --- a/src/lib/components/chat/Messages/ResponseMessage.svelte +++ b/src/lib/components/chat/Messages/ResponseMessage.svelte @@ -279,15 +279,23 @@ ) ?.at(0) ?? undefined; + console.log(voice); + const speak = new SpeechSynthesisUtterance(message.content); + console.log(speak); + speak.onend = () => { speaking = null; if ($settings.conversationMode) { document.getElementById('voice-input-button')?.click(); } }; - speak.voice = voice; + + if (voice) { + speak.voice = voice; + } + speechSynthesis.speak(speak); } }, 100);