mirror of
https://github.com/jambonz/jambonz-webapp.git
synced 2026-01-25 02:08:19 +00:00
fix regression bug: new app does not save tts voice by default (#535)
This commit is contained in:
@@ -139,7 +139,12 @@ export const SpeechProviderSelection = ({
|
|||||||
ttsEffectTimer.current = setTimeout(() => {
|
ttsEffectTimer.current = setTimeout(() => {
|
||||||
configSynthesis();
|
configSynthesis();
|
||||||
}, 200);
|
}, 200);
|
||||||
}, [synthVendor, synthLabel, serviceProviderSid]);
|
}, [
|
||||||
|
synthVendor,
|
||||||
|
synthLabel,
|
||||||
|
serviceProviderSid,
|
||||||
|
application_speech_synthesis_voice,
|
||||||
|
]);
|
||||||
|
|
||||||
// Get Recognizer languages and voices
|
// Get Recognizer languages and voices
|
||||||
useEffect(() => {
|
useEffect(() => {
|
||||||
@@ -246,6 +251,15 @@ export const SpeechProviderSelection = ({
|
|||||||
// Extract model
|
// Extract model
|
||||||
if (json.models && json.models.length) {
|
if (json.models && json.models.length) {
|
||||||
setSynthesisModelOptions(json.models);
|
setSynthesisModelOptions(json.models);
|
||||||
|
if (
|
||||||
|
synthVendor === VENDOR_DEEPGRAM &&
|
||||||
|
(!application_speech_synthesis_voice ||
|
||||||
|
!json.models.some(
|
||||||
|
(m) => m.value === application_speech_synthesis_voice,
|
||||||
|
))
|
||||||
|
) {
|
||||||
|
setSynthVoice(json.models[0].value);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (json.tts && json.tts.length) {
|
if (json.tts && json.tts.length) {
|
||||||
@@ -337,7 +351,6 @@ export const SpeechProviderSelection = ({
|
|||||||
|
|
||||||
const updateTtsVoice = (language: string, voice: string) => {
|
const updateTtsVoice = (language: string, voice: string) => {
|
||||||
if (shouldUpdateTtsVoice.current) {
|
if (shouldUpdateTtsVoice.current) {
|
||||||
console.log("xhoaluu");
|
|
||||||
setSynthLang(language);
|
setSynthLang(language);
|
||||||
setSynthVoice(voice);
|
setSynthVoice(voice);
|
||||||
shouldUpdateTtsVoice.current = false;
|
shouldUpdateTtsVoice.current = false;
|
||||||
@@ -389,19 +402,6 @@ export const SpeechProviderSelection = ({
|
|||||||
});
|
});
|
||||||
};
|
};
|
||||||
|
|
||||||
useEffect(() => {
|
|
||||||
if (
|
|
||||||
synthVendor === VENDOR_DEEPGRAM &&
|
|
||||||
synthesisModelOptions.length > 0 &&
|
|
||||||
!synthesisModelOptions.some(
|
|
||||||
(m) => m.value === application_speech_synthesis_voice,
|
|
||||||
)
|
|
||||||
) {
|
|
||||||
setSynthVoice(synthesisModelOptions[0].value);
|
|
||||||
} else {
|
|
||||||
setSynthVoice(application_speech_synthesis_voice || "");
|
|
||||||
}
|
|
||||||
}, [synthesisModelOptions, application_speech_synthesis_voice]);
|
|
||||||
return (
|
return (
|
||||||
<>
|
<>
|
||||||
<fieldset>
|
<fieldset>
|
||||||
|
|||||||
Reference in New Issue
Block a user