js 实现语音阅读

代码:

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

.

posted @ 2022-09-15 09:17  每天都要进步一点点  阅读(38)  评论(0)    收藏  举报