如何在python中将语音与列表进行比较

时间:2019-01-30 07:36:57

标签: python list arraylist voice-recognition voice

这是我正在使用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()

0 个答案:

没有答案