我正在使用spyder IDE将我的语音文本转换项目使用google Speech to text api。我已将Google语音集成到代码中的文本中,并出现类似“配额耗尽”的错误。在Google控制台中转到仪表板后,我可以看到可用配额。
import speech_recognition as sr
r = sr.Recognizer()
sample_call = sr.AudioFile('sample_call_new.flac')
with sample_call as source:
audio = r.record(source)
type(audio)
response = r.recognize_google_cloud(audio,language='en-US', show_all=True)
print(response)
错误
identify_google_cloud中的文件“ C:\ ProgramData \ Anaconda3 \ lib \ site-packages \ speech_recognition__init __。py”,第932行 引发RequestError(e)
RequestError:https://speech.googleapis.com/v1/speech:recognize?alt=json返回了“配额指标'speech.googleapis.com/default_requests'超出了配额,并限制了服务'speech的'DefaultRequestsPerMinutePerProject'。消费者“ project_number:764086051850”的googleapis.com”。详细信息:“ [{'@ type':'type.googleapis.com/google.rpc.Help”,“链接”:[{'description':'Google开发者控制台API密钥','url':'{{3 }}'}]}]“> *