这是我正在使用Pocketsphinx的代码,我想将我的声音与这些单词进行比较,但无法正常工作。
from pocketsphinx import LiveSpeech
import speech_recognition as sr
'''The start of Speech system is here,'''
def chair_offline():
words = ["LEFT","RIGHT","FORWARD","BACKWARD","STOP","RUN"]
r = sr.Recognizer()
for audioo in LiveSpeech():
res = str(audioo)
if res in words:
print(res)
else:
print("sorry modle not train")
chair_offline()