响应时间是延迟

时间:2019-04-11 11:38:17

标签: speech-recognition

我正在使用google_speech识别来制作语音识别系统。 但是问题是响应时间有些延迟或有时无法识别。我该如何解决这个问题。代码在这里。

r = sr.Recognizer()
with sr.Microphone() as source:
     print("Please wait. Calibrating microphone...")

#收听5秒并创建环境噪声能量级别          r.adjust_for_ambient_noise(来源,时长= 5)

r.dynamic_energy_threshold = True

audio = r.listen(source)
print("request send")

尝试:     message = r.recognize_google(audio).lower()

print('you said:'+ message)
print(rows)
except sr.UnknownValueError:
        print("Could not recognize your voice")
except sr.RequestError as e:
        print("not a request resul,{0}".format(e))

0 个答案:

没有答案
相关问题