还记得曾经那个能识别语音的API吗?当时一直在想,如果能让浏览器替我念出文字就好了。现在chrome的最新版本Version 33 中您只要按F12然后在console里面输入这段代码,您就能听到浏览器阅读。

var msg = new SpeechSynthesisUtterance('ni hao,zhi hui xing qiu qunhao:281151953');
msg.lang = 'zh';
msg.voice = speechSynthesis.getVoices().filter(function(voice) {
return voice.name == 'Whisper';
})[0];
speechSynthesis.speak(msg);

  

 

var msg = new SpeechSynthesisUtterance('ni hao,zhi hui xing qiu qunhao:281151953');
msg.lang = 'zh';
msg.voice = speechSynthesis.getVoices().filter(function(voice) {
return voice.name == 'Whisper';
})[0];
speechSynthesis.speak(msg);

相关文章:

  • 2021-04-16
  • 2021-07-30
  • 2021-11-03
  • 2022-12-23
  • 2022-03-06
  • 2021-11-26
  • 2021-12-29
  • 2021-07-23
猜你喜欢
  • 2022-12-23
  • 2021-04-23
  • 2021-11-20
  • 2022-12-23
  • 2022-12-23
相关资源
相似解决方案