Pocketsphinx-python无法在我的嵌入式设备上正常工作

2024-06-16 09:57:04 发布

您现在位置:Python中文网/ 问答频道 /正文

我想在嵌入式设备上安装pocketsphinxpython,该设备的环境是用Buildroot构建的。不幸的是,当我运行代码时会收到错误日志。有问题的设备是一个智能扬声器

这是我的密码:

from pocketsphinx import LiveSpeech
for phrase in LiveSpeech():
    print(phrase)

下面是我的结果:

 python test_pocketsphinx.py2019-04-05 15:02:16.799 [1ae2] I MRMLoggerDelegate:WHA:text=Device\:sendHeartBeat\:seq\=76\,remote\=XX796e\,roundTripMs\=10\,masterXmitTimestamp\=1495055341
 2019-04-05 15:02:16.810 [1ae3] I MRMLoggerDelegate:WHA:text=Device\:sendHeartBeat\:seq\=76\,remote\=XXa5d6\,roundTripMs\=21\,masterXmitTimestamp\=14950553322185\,slaveRecvTimestamp\=771
2019-04-05 15:02:16.816 [1ae4] I MRMLoggerDelegate:WHA:text=Device\:sendHeartBeat\:seq\=76\,remote\=XXc0ee\,roundTripMs\=27\,masterXmitTimestamp\=14950553364101\,slaveRecvTimestamp\=776

 Failed to create secure directory (/root/.config/pulse): No such file or directory
Error opening audio device (null) for capture: Connection refused
Traceback (most recent call last):
File "test_pocketsphinx.py", line 2, in <module>
for phrase in LiveSpeech():
File "usr/lib/python2.7/site-packages/pocketsphinx/__init__.py", line 206, in __init__
File "usr/lib/python2.7/site-packages/sphinxbase/ad_pulse.py", line 124, in __init__
RuntimeError: new_Ad returned -1

Tags: textinforremotedeviceseqfilepocketsphinx