From 6cf897219e86d6c90e4d6bfb7db14cf4f2dfafec Mon Sep 17 00:00:00 2001 From: johnbenac Date: Fri, 5 Apr 2024 18:41:36 -0400 Subject: [PATCH 1/2] Added toastr messages to tts index file --- public/scripts/extensions/tts/index.js | 3 +++ 1 file changed, 3 insertions(+) diff --git a/public/scripts/extensions/tts/index.js b/public/scripts/extensions/tts/index.js index b86e42ede..b093e9053 100644 --- a/public/scripts/extensions/tts/index.js +++ b/public/scripts/extensions/tts/index.js @@ -465,6 +465,7 @@ async function processAudioJobQueue() { playAudioData(currentAudioJob); talkingAnimation(true); } catch (error) { + toastr.error(error.toString()); console.error(error); audioQueueProcessorReady = true; } @@ -579,6 +580,7 @@ async function processTtsQueue() { } tts(text, voiceId, char); } catch (error) { + toastr.error(error.toString()); console.error(error); currentTtsJob = null; } @@ -648,6 +650,7 @@ function onRefreshClick() { initVoiceMap(); updateVoiceMap(); }).catch(error => { + toastr.error(error.toString()); console.error(error); setTtsStatus(error, false); }); From 3b6c32113f6d351a6971893bc70ee55fc4a8ba95 Mon Sep 17 00:00:00 2001 From: johnbenac Date: Fri, 5 Apr 2024 18:57:51 -0400 Subject: [PATCH 2/2] added await to tts to properly catch the error on this async function --- public/scripts/extensions/tts/index.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/public/scripts/extensions/tts/index.js b/public/scripts/extensions/tts/index.js index b093e9053..5b80b172b 100644 --- a/public/scripts/extensions/tts/index.js +++ b/public/scripts/extensions/tts/index.js @@ -578,7 +578,7 @@ async function processTtsQueue() { toastr.error(`Specified voice for ${char} was not found. Check the TTS extension settings.`); throw `Unable to attain voiceId for ${char}`; } - tts(text, voiceId, char); + await tts(text, voiceId, char); } catch (error) { toastr.error(error.toString()); console.error(error);