fix app cannot set elevenlab tts (#386)

This commit is contained in:
Hoan Luu Huu authored and GitHub committed 2024-01-17 07:30:36 -05:00
1 parent 67b7792d04
commit af1ba3a15c
1 file changed
+2 -7
@@ -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) {