還記得曾經那個能識別語音的API嗎?當時一直在想,若是能讓瀏覽器替我念出文字就行了。如今chrome的最新版本Version 33 中您只要按F12而後在console裏面輸入這段代碼,您就能聽到瀏覽器閱讀。web
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);
81151953chrome