WebkitSpeechRecognition Returning Network Error in Electron

﹥>﹥吖頭↗ 提交于 2019-12-01 06:36:01

问题


Recently (in the past 1.5 weeks) the javascript library WebkitSpeechRecognition has refused to work properly. I've tested other electron applications that utilize the library (smart-mirror by evan cohen) and have run into issues with those.

It throws network errors under every circumstance I've tested it. The library seems to work fine in standard browser environments but I can't seem to get it to work with electron. Does anybody have any experience in wrestling with this?


回答1:


It seems that Google has removed this feature for electron. See this discussion.




回答2:


Configure your own Google Speech API credentials using https://console.developers.google.com and then set them on your system's environment variables. I had the same issue and got it working with this way. Make sure to restart your system after configuring the environment variables. Sometimes they don't get into affect immediately.

Please refer for more detailed steps: https://docs.smart-mirror.io/docs/howto/how_to_obtain_chromium_speech_keys.html

GOOGLE_API_KEY, GOOGLE_DEFAULT_CLIENT_ID, GOOGLE_DEFAULT_CLIENT_SECRET set their value to Key, ClientID and ClientSecret respectively.



来源:https://stackoverflow.com/questions/36214413/webkitspeechrecognition-returning-network-error-in-electron

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!