From e8f4da6a2ffd298d02e07ec49864796d232ab23d Mon Sep 17 00:00:00 2001 From: Eyal Gruss Date: Sun, 10 Nov 2024 23:19:04 +0200 Subject: [PATCH] try to fix firefox android speech button - take 3 --- resen/kaddish/script.js | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/resen/kaddish/script.js b/resen/kaddish/script.js index 9c8196c..29d3453 100644 --- a/resen/kaddish/script.js +++ b/resen/kaddish/script.js @@ -82,7 +82,12 @@ play.addEventListener('click', event => { utter.lang = voice.lang } utter.rate = .6 - utter.onend = e => {if (!e.charLength) play.click()} + utter.onend = e => {console.log('end fired'); if (!e.charLength) play.click()} + utterThis.onerror = (event) => { + console.log( + `An error has occurred with the speech synthesis: ${event.error}`, + ); +}; speechSynthesis.speak(utter) } else speechSynthesis.cancel() }) \ No newline at end of file