2
我使用下面的代码使用语音识别在Python语音识别API“兵”是很慢
import speech_recognition as sr
# obtain audio from the microphone
r = sr.Recognizer()
with sr.Microphone() as source:
r.adjust_for_ambient_noise(source)
print("Say something!")
audio = r.listen(source)
print(type(audio))
BING_KEY = 'KEY' # Microsoft Bing Voice Recognition API keys 32-character lowercase hexadecimal strings
try:
print(type(r.recognize_bing(audio, key=BING_KEY)))
except sr.UnknownValueError:
print("Microsoft Bing Voice Recognition could not understand audio")
except sr.RequestError as e:
print("Could not request results from Microsoft Bing Voice Recognition service; {0}".format(e))
但它是非常缓慢的,它甚至落后了20秒!这是非常缓慢的,你可以在Python中推荐任何实时语音识别API?或任何建议修改该代码
我使用Python,所以如果你有一个代码示例的Python中的REST api我会非常感激 –