我正在尝试将 LiveSpeech 与我训练过的模型和字典一起使用:
#!/usr/bin/env python
from pocketsphinx import LiveSpeech
hmm = '/home/ridwan/sphinx/other1/output/other1.ci_cont' #folder of the acoustic model
lm = '/home/ridwan/sphinx/other1/output/other1.lm.DMP' #language model
dict = '/home/ridwan/sphinx/other1/output/other1.dic' #the phonetic dictionary
recognizer = LiveSpeech (verbose = False, sampling_rate = 16000, buffer_size = 2048,
no_search = False, full_utt = False,
hmm = hmm, lm = lm, dic = dict)
for phrase in recognizer:
print (phrase)
但我收到以下错误:
Traceback(最近一次通话最后一次):文件“./main.py”,第 3 行,从 pocketsphinx 导入 LiveSpeech ImportError:无法导入名称 LiveSpeech
注意:我已经从CMU Sphinx成功安装了 pocketsphinx