PC WEB语音合成,语音播放 var msg = new SpeechSynthesisUtterance();var voices = window.speechSynthesis.getVoices();msg.voice = voices[64]; // Note: some voices don't support altering paramsmsg.voiceURI = 'Google 普通话(中国大陆
var msg = new SpeechSynthesisUtterance(); var voices = window.speechSynthesis.getVoices(); msg.voice = voices[64]; // Note: some voices don't support altering params msg.voiceURI = 'Google 普通话(中国大陆)'; msg.volume = 1; // 0 to 1 msg.rate = 2; // 0.1 to 10 msg.pitch = 0; //0 to 2 msg.text = '你好,世界!'; msg.lang = 'zh-CN'; speechSynthesis.speak(msg);