我还没有找到一种运行Pocketsphinx包装器的方法,它应该很容易知道说了哪些词
提供的一些代码看起来就像这样
from pocketsphinx import LiveSpeech
speech = LiveSpeech(lm=False, keyphrase='forward', kws_threshold=1e-20)
for phrase in speech:
print(phrase.segments(detailed=True))但是什么都不起作用,我的终端输出什么也没有显示。只有空白处。我如何检测任何唤醒字词?
发布于 2019-07-12 02:21:07
我的工作是将运行Pocketsphinx的命令放入子进程中,并将输出通过管道发送到我的python脚本中。
import subprocess
p = subprocess.Popen("pocketsphinx_continuous -inmic yes", stdout=subprocess.PIPE, bufsize=1, shell=True)
for line in iter(p.stdout.readline, b''):
print line.upper(),
p.stdout.close()
p.wait()在终端中,显示"print line.upper()“的代码行如下所示
INFO: continuous.c(275): Ready...
INFO: continuous.c(261): Listening...
A lot of various pieces of information
THE WORDS YOU SAID这是实时工作的!
https://stackoverflow.com/questions/56995197
复制相似问题