Merge pull request #2019 from johnbenac/TTS_Toastr_Error_Message

Added toastr messages to tts index file
This commit is contained in:
Cohee
2024-04-06 15:28:59 +03:00
committed by GitHub

View File

@ -465,6 +465,7 @@ async function processAudioJobQueue() {
playAudioData(currentAudioJob); playAudioData(currentAudioJob);
talkingAnimation(true); talkingAnimation(true);
} catch (error) { } catch (error) {
toastr.error(error.toString());
console.error(error); console.error(error);
audioQueueProcessorReady = true; audioQueueProcessorReady = true;
} }
@ -577,8 +578,9 @@ async function processTtsQueue() {
toastr.error(`Specified voice for ${char} was not found. Check the TTS extension settings.`); toastr.error(`Specified voice for ${char} was not found. Check the TTS extension settings.`);
throw `Unable to attain voiceId for ${char}`; throw `Unable to attain voiceId for ${char}`;
} }
tts(text, voiceId, char); await tts(text, voiceId, char);
} catch (error) { } catch (error) {
toastr.error(error.toString());
console.error(error); console.error(error);
currentTtsJob = null; currentTtsJob = null;
} }
@ -648,6 +650,7 @@ function onRefreshClick() {
initVoiceMap(); initVoiceMap();
updateVoiceMap(); updateVoiceMap();
}).catch(error => { }).catch(error => {
toastr.error(error.toString());
console.error(error); console.error(error);
setTtsStatus(error, false); setTtsStatus(error, false);
}); });