Uberi / speech_recognition

Speech recognition module for Python, supporting several engines and APIs, online and offline.

Home Page:https://pypi.python.org/pypi/SpeechRecognition/

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

(question) Can I force offline mode?

EclipseGame18 opened this issue · comments

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!

commented

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?