-1

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

Inzamam Malik
  • 3,238
  • 3
  • 29
  • 61

2 Answers2

6

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.

  • do you mean there is way to do that without internet? please tell me any other way to do the same without internet if possible, even with 50% accuracy I'm okay, it is just yes no yeah nope etc in my case – Inzamam Malik Nov 29 '18 at 18:01
  • 2
    I understand that there is an alternative using the Pocket-Sphinx Python library which can work offline. More info here: https://pypi.org/project/pocketsphinx/ Then your Python code could be called using a JavaScript Ajax call or jQuery: $.ajax({ type: "POST", url: "~/pythoncode.py", data: { param: text} }).done(function( o ) { // do something }); – Hernan D'Andrea Dec 01 '18 at 09:59
  • And here you have another Python library for that: https://pypi.org/project/SpeechRecognition/ – Hernan D'Andrea Dec 01 '18 at 10:11
0

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.

Ezenhis
  • 997
  • 9
  • 14