why javascript Speech Recognition api is not worki

2020-05-09 19:16发布

I was working with javascript speech recognition api(new webkitSpeechRecognition()) and i amazed why it is not working without internet since it is javascript code so it should work offline

I checked the network section of chrome developer tools, it is even not making request to internet

2条回答
在下西门庆
2楼-- · 2020-05-09 19:29

On Chrome, using Speech Recognition on a web page involves a server-based recognition engine. Your audio is sent to a web service for recognition processing, so it won't work offline.

查看更多
霸刀☆藐视天下
3楼-- · 2020-05-09 19:35

Looking at https://developer.mozilla.org/en-US/docs/Web/API/SpeechRecognition:

SpeechRecognition.serviceURI
Specifies the location of the speech recognition service used by the current SpeechRecognition to handle the actual recognition. The default is the user agent's default speech service.

The actual recognition is done by a 3rd party server.
I assume the task of speech recognition currently is just too much for a browser to cope with on it's own or requires a big database.

查看更多
登录 后发表回答