A
A
arusinov852018-10-28 19:04:19
Python
arusinov85, 2018-10-28 19:04:19

Why doesn't pocketsphinx speech recognition work?

when you run this code:

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)
дает вот такие логи:
Allocating 32 buffers of 2500 samples each
Traceback (most recent call last):
  File "D:\ITproj\Python\zadacha2.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
[Finished in 0.2s with exit code 1]
[shell_cmd: python -u "D:\ITproj\Python\zadacha2.py"]
[dir: D:\ITproj\Python]
[path: C:\Windows\system32;C:\Windows;C:\Windows\System32\Wbem;C:\Windows\System32\WindowsPowerShell\v1.0\;C:\Program Files (x86)\NVIDIA Corporation\PhysX\Common;C:\Users\Алишер\AppData\Local\Programs\Python\Python36\Scripts\;C:\Users\Алишер\AppData\Local\Programs\Python\Python36\;]

Answer the question

In order to leave comments, you need to log in

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question