我目前正在使用python
脚本开发人与NAO机器人之间的互动游戏,目前我正在开发speechRecognition
部分:
from naoqi import ALProxy
from ar_markers.hamming.detect import detect_markers
IP = ""
tts = ALProxy("ALTextToSpeech", IP, 9559)
asr = ALProxy("ALSpeechRecognition", IP, 9559)
asr.setLanguage("English")
vocabulary = ["yes", "help"]
asr.setVocabulary(vocabulary, False)
我定义了此功能:
def getTheOtherMatchingPair():
global StringPair
tts.say("The other matching pair is ")
tts.say(StringPair)
无论如何我是否可以找到单词,例如,当用户说“帮助”时,将调用getTheOtherMatchingPair
函数,并且机器人会说出结果吗?