Google语音转文字不适用于小型音频

时间:2019-02-20 03:14:56

标签: python google-api speech-recognition speech-to-text

我希望它能够识别说话者正在讲字母(价值0.28秒的音频),但是它给出了未知的值错误

import speech_recognition as sr
r=sr.Recognizer()

l1=sr.AudioFile("clips/a.wav")
l2=sr.AudioFile("clips/B.wav")
with l1 as source:
   a1=r.record(source,offset=.28,duration=.28)
with l2 as source:
   a2=r.record(source) 

 print(r.recognize_google(a1))

speech_recognition.UnknownValueError

0 个答案:

没有答案