JavaScript 语音合成cheatsheet
贡献者:BAI
SpeechSynthesisUtterance
实验属性,不兼容 IE 所有版本
JSfunction speak(message) { var msg = new SpeechSynthesisUtterance(message); var voices = window.speechSynthesis.getVoices(); msg.voice = voices[0]; window.speechSynthesis.speak(msg);}
JSspeak("Hello, world");
详见: SpeechSynthesisUtterance (developer.mozilla.org)