Python 如何检测唤醒词或是否说了任何词
还没有找到运行Pocketsphinx包装器的方法,这样就很容易知道说了哪些词 提供的一些代码看起来非常像这样Python 如何检测唤醒词或是否说了任何词,python,pocketsphinx,Python,Pocketsphinx,还没有找到运行Pocketsphinx包装器的方法,这样就很容易知道说了哪些词 提供的一些代码看起来非常像这样 from pocketsphinx import LiveSpeech speech = LiveSpeech(lm=False, keyphrase='forward', kws_threshold=1e-20) for phrase in speech: print(phrase.segments(detailed=True)) 但是什么都不起作用,我的终端输出实际上什
from pocketsphinx import LiveSpeech
speech = LiveSpeech(lm=False, keyphrase='forward', kws_threshold=1e-20)
for phrase in speech:
print(phrase.segments(detailed=True))
但是什么都不起作用,我的终端输出实际上什么也没说。只有空白。如何检测唤醒词?我的工作是将运行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
这是实时的