代码:
@Bind() speak(sentence) { // 生成需要语音朗读的内容 const utterance = new SpeechSynthesisUtterance(sentence); // 由浏览器发起语音朗读的请求 window.speechSynthesis.speak(utterance); }
.