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我會非常感激 –