Uberi / speech_recognition

Speech recognition module for Python, supporting several engines and APIs, online and offline.
https://pypi.python.org/pypi/SpeechRecognition/
BSD 3-Clause "New" or "Revised" License
8.47k stars 2.41k forks source link

(question) Can I force offline mode? #723

Open EclipseGame18 opened 1 year ago

EclipseGame18 commented 1 year ago

Hey, I am using recognize_vosk as the speech recognition engine. I know I can run it offline and when I unplug my internet cable from my computer it works really well and is very fast, however, when my computer has access to the internet the recognition is much slower and is at a similar speed to recognize_google. Can I force speech recognition to only use offline mode? I have tried to find a way but I have found nothing of use. Thanks for any help in advance!

Luca-Pozzi commented 7 months ago

The behavior you report is quite odd. The recognize_vosk method can just work offline.

As you can see from the source code, the method looks for a downloaded Vosk model, and throws an error if such model is not available (or not found) on your local system. https://github.com/Uberi/speech_recognition/blob/765e2cfd65b13d00f771ff54fabcc26537eb8de4/speech_recognition/__init__.py#L1433C5-L1449C32

Could you provide the code you are using, so that we can try to understand what is going on?