diff --git a/speech_recognition/__init__.py b/speech_recognition/__init__.py index 095d8e89..37b17292 100644 --- a/speech_recognition/__init__.py +++ b/speech_recognition/__init__.py @@ -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);