const synth = window.speechSynthesis;
const msg = new SpeechSynthesisUtterance();
handleSpeak(txt) {
msg.text = txt;
msg.lang = “zh-CN”;
msg.volume = “1”;
msg.rate = 1;
msg.pitch = 1;
synth.speak(msg);
},
this.handleSpeak(“您有新的告警订单,请及时处理!”);// 调用
、可以参考文章: https://blog.csdn.net/qq_40571631/article/details/89738575