let speech = new window.SpeechSynthesisUtterance();
// 如果过了0点要刷新
let speakText = `床前明月光,疑是地上霜`
speech.text = speakText;
speech.pitch = 1; // 设置话语的音调(0-2 默认1,值越大越尖锐,越低越低沉)
speech.rate = 0.9; // 设置说话的速度(0.1-10 默认1,值越大语速越快,越小语速越慢)
speech.volume = 10; // 设置说话的音量
speech.lang = "zh-CN"; // 设置播放语言
speechSynthesis.speak(speech);
语音播报功能
最新推荐文章于 2024-07-17 15:26:15 发布