Skip to content

Commit

Permalink
try to fix firefox android speech button - take 3
Browse files Browse the repository at this point in the history
  • Loading branch information
eyaler committed Nov 10, 2024
1 parent 156ff4e commit e8f4da6
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion resen/kaddish/script.js
Original file line number Diff line number Diff line change
Expand Up @@ -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()
})

0 comments on commit e8f4da6

Please sign in to comment.