From af1ba3a15ccfe301751b190ac395fceedb8a84e9 Mon Sep 17 00:00:00 2001 From: Hoan Luu Huu <110280845+xquanluu@users.noreply.github.com> Date: Wed, 17 Jan 2024 19:30:36 +0700 Subject: [PATCH] fix app cannot set elevenlab tts (#386) --- .../internal/views/applications/speech-selection.tsx | 9 ++------- 1 file changed, 2 insertions(+), 7 deletions(-) diff --git a/src/containers/internal/views/applications/speech-selection.tsx b/src/containers/internal/views/applications/speech-selection.tsx index b6a29b7..eb2ed6b 100644 --- a/src/containers/internal/views/applications/speech-selection.tsx +++ b/src/containers/internal/views/applications/speech-selection.tsx @@ -161,7 +161,7 @@ export const SpeechProviderSelection = ({ if (synthesisSupportedLanguagesAndVoices) { // Extract Voice const voicesOpts = - synthesisSupportedLanguagesAndVoices.tts.find((lang) => { + synthesisSupportedLanguagesAndVoices.tts?.find((lang) => { if (synthVendor === VENDOR_ELEVENLABS && lang.voices.length > 0) { return true; } @@ -227,12 +227,7 @@ export const SpeechProviderSelection = ({ // Samve Voices applied to all languages // Voices are only available for the 1st language. setSynthLang(ELEVENLABS_LANG_EN); - const newLang = json.tts.find( - (lang) => lang.value === ELEVENLABS_LANG_EN - ); - if (newLang) { - setSynthVoice(newLang.voices[0].value); - } + setSynthVoice(json.tts[0].voices[0].value); return; } if (synthVendor === VENDOR_WHISPER) {