Skip to content

Commit

Permalink
Final update with help of @nshmyrev
Browse files Browse the repository at this point in the history
Finnaly final update
  • Loading branch information
mytja authored Sep 19, 2020
1 parent a1a7a14 commit 274f5eb
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions speech_recognition/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -1395,13 +1395,12 @@ def recognize_vosk(self, audio_data, language='en'):
from vosk import Model, KaldiRecognizer

assert isinstance(audio_data, AudioData), "Data must be audio data"
assert isinstance(language, str), "Language data"

if not hasattr(self, 'vosk_model'):
if not os.path.exists("model"):
return "Please download the model from https://github.com/alphacep/vosk-api/blob/master/doc/models.md and unpack as 'model' in the current folder."
exit (1)
self.vosk_model = Model()
self.vosk_model = Model("model")

rec = KaldiRecognizer(self.vosk_model, 16000);

Expand Down

0 comments on commit 274f5eb

Please sign in to comment.