让浏览器发出声音

const speak = (sentence) => {
  const utterance = new SpeechSynthesisUtterance(sentence);
  window.speechSynthesis.speak(utterance);
};
speak('你好')

  

posted @ 2022-05-30 09:28  小万子呀  阅读(95)  评论(0编辑  收藏  举报