Can't Chrome's speechSynthesis work offline?

后端 未结 1 426
醉梦人生
醉梦人生 2020-12-19 06:16

I was playing with Chrome\'s speechSynthesis

msg = new SpeechSynthesisUtterance(\"some text\");
msg.lang = \"fr-FR\" ;
window.speechSynthesis.speak(msg);  
<         


        
相关标签:
1条回答
  • 2020-12-19 06:23

    Speech synthesis voices are either local on the device or come from remote speech synthesizer services. If the voice is a remote service, the browser will only be able to use it if it is online and can connect to it.

    You don't say which environment you are on, but the Google Français voice that would be used for fr-FR on Windows and OS X is a remote service, so it doesn't work offline.

    You can check which voices are available on a device by calling speechSynthesis.getVoices() and checking the localService property for each voice.

    0 讨论(0)
提交回复
热议问题