Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- 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)
- Traceback (most recent call last):
- File "C:UsersАдминDesktoppythonakys.py", line 14, in <module>
- dic=os.path.join(model_path, 'ru.dic')
- File "C:UsersАдминAppDataLocalProgramsPythonPython36libsite-packagespocketsphinx__init__.py", line 208, in __init__
- super(LiveSpeech, self).__init__(**kwargs)
- File "C:UsersАдминAppDataLocalProgramsPythonPython36libsite-packagespocketsphinx__init__.py", line 90, in __init__
- super(Pocketsphinx, self).__init__(config)
- File "C:UsersАдминAppDataLocalProgramsPythonPython36libsite-packagespocketsphinxpocketsphinx.py", line 272, in __init__
- this = _pocketsphinx.new_Decoder(*args)
- RuntimeError: new_Decoder returned -1
Add Comment
Please, Sign In to add comment