Greetings...
I am trying to get speech synthesis to work such that when a widget receives an onValue it speaks something. In my outermost panel onCreate I put:
globals.synth = window.speechSynthesis;
Then in the widget onValue (which is a fragment actually), I have:
const utterThis = new SpeechSynthesisUtterance(value + "");
globals.synth.speak(utterThis);
console.log(value)
It is actually just counting when it receives an increasing number.
In firefox, it just repeats endlessly on the first value. I can do this:
const utterThis = new SpeechSynthesisUtterance(value + "");
globals.synth.speak(utterThis);
setTimeout(() => {
globals.synth.cancel()
}, 800);
Which will make it stop, but different numbers have different utterance lengths so that is not quite right.
Chromium does not work at all. I assume because of this:
This might be more of a javascript browser compatibility issue, but I was thinking solving the chrome problem might also make it work in firefox. Any somewhat stable solutions very welcome. By no way am I married to the web speech api also.
Thanks in advance.