const synth = window.speechSynthesis;
const msg = new SpeechSynthesisUtterance();
msg.text = '这是一个测试用例';
msg.lang = 'zh-CN';
msg.rate = 3; //设置语速
// msg.pitch = 1; //设置语调
// 播放语音
synth.speak(msg);
SpeechSynthesisUtterance 语音合成
最新推荐文章于 2024-05-23 00:14:45 发布