使用谷歌离线语音识别的API:python

时间:2018-01-04 14:29:58

标签: python speech-recognition

我想离线使用谷歌api语音识别,这是我的代码,但它只能在线工作。

import speech_recognition as sr

r = sr.Recognizer()

with sr.Microphone() as source:
     print ('Say Something!')
     audio = r.listen(source)
     print ('Done!')

text = r.recognize_google(audio)
print(text)

0 个答案:

没有答案