通过jiavascript将文本内容转化为语音播放,代码如下:
<body> <button onclick="start()">点击</button> <script> var text = '语音输入开始' var msg = new SpeechSynthesisUtterance(text) function start () { msg.value = 2 // 音量 msg.rate = 0.8 // 语速 window.speechSynthesis.speak(msg) } </script> </body>
标签:text,javascript,var,语音,msg,文本 From: https://www.cnblogs.com/xgn666/p/17036833.html