Client side speech synthesis


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 + "");

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 + "");
setTimeout(() => {
}, 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.

Realizing now that it is better to just have sample playback. I have not tried yet, but I assume it is pretty straightforward with an html audio tag to play a sample on onValue of a widget. If there are any quirks with idea, suggestions welcome. Thanks...

I have a created a new discussion for client side sample playback