I used speechSynthesis API in this way:
speechSynthesis.speak(new SpeechSynthesisUtterance(\"hello world\"));
But right now I get error aft
I resorted to swal("Click OK to speak").then(() => speakButton.click()); (with https://sweetalert.js.org) -- https://patarapolw.github.io/tts-api/?q=你好&lang=zh-CN&rate=0.8
swal("Click OK to speak").then(() => speakButton.click());
Note that if (confirm("Click OK to speak")) speakButton.click() doesn't work.
if (confirm("Click OK to speak")) speakButton.click()