在Pocketsphinx中指定和确定语音命令

时间:2019-03-26 16:10:55

标签: python pocketsphinx

我如何在PocketSphinx中指定和确定语音命令 我几乎需要认出十个字, 我已经尝试过此通用代码,但它不正确!!!:

import speech_recognition as sr
 r = sr.Recognizer()
 with sr.Microphone() as source:
      print("Say something!")
      audio = r.listen(source)
 try:
     print("Sphinx thinks you said " + r.recognize_sphinx(audio))
 except sr.UnknownValueError:
     print("Sphinx could not understand audio")
 except sr.RequestError as e:
     print("Sphinx error; {0}".format(e))

0 个答案:

没有答案