import os from pocketsphinx import LiveSpeech, get_model_path model_path = get_model_path() speech = LiveSpeech( verbose=False, sampling_rate=16000, buffer_size=2048, no_search=False, full_utt=False, hmm=os.path.join(model_path, 'zero_ru.cd_cont_4000'), lm=os.path.join(model_path, 'ru.lm'), dic=os.path.join(model_path, 'ru.dic') ) print("Say something!") for phrase in speech: print(phrase) 

At start the error takes off:

 Traceback (most recent call last): File "C:\Users\Админ\Desktop\python\akys.py", line 14, in <module> dic=os.path.join(model_path, 'ru.dic') File "C:\Users\Админ\AppData\Local\Programs\Python\Python36\lib\site-packages\pocketsphinx\__init__.py", line 208, in __init__ super(LiveSpeech, self).__init__(**kwargs) File "C:\Users\Админ\AppData\Local\Programs\Python\Python36\lib\site-packages\pocketsphinx\__init__.py", line 90, in __init__ super(Pocketsphinx, self).__init__(config) File "C:\Users\Админ\AppData\Local\Programs\Python\Python36\lib\site-packages\pocketsphinx\pocketsphinx.py", line 272, in __init__ this = _pocketsphinx.new_Decoder(*args) RuntimeError: new_Decoder returned -1 

I tried to solve it in different ways. Nothing comes out; the dictionary, the language model and the acoustic model in the folder are there.

    1 answer 1

    If you correct verbose = False with verbose = True, you can read a more detailed description of the problem in the output. Most likely the model is not in the right directory.