gpt4 book ai didi

google-cloud-platform - Google Cloud Speech API 请求中出现错误

转载 作者:行者123 更新时间:2023-12-02 20:46:53 26 4
gpt4 key购买 nike

当我向 Google Cloud Speech API 发出请求时,出现此错误:“错误”: { “代码”:400, "message": "请求包含无效参数。", “状态”:“INVALID_ARGUMENT

我的curl命令如下所示:curl -s -k -H“内容类型:application/json”-H“授权:承载者 xxxxxxx”\https://speech.googleapis.com/v1beta1/speech:syncrecognize -d @sync-request.json

我的配置文件是这样的:

      {
'config': {
'encoding':'FLAC',
'sampleRate': 16000,
'languageCode': 'de-DE'
},
'audio': {
'uri':'https://storage.googleapis.com/project_name/xxxx_Ger16.flac'
}
}

请求中缺少或无效的内容是什么?谢谢。

最佳答案

收到的错误消息表明您在 JSON 请求正文中提供的属性无效。正如您在评论中所确认的那样,Cloud Storage 资源的 audio.uri 值应与模式 gs://bucket_name/object_name 匹配。

类型 RecognitionAudio 的请求正文中的 audio 对象。相关文档证实了您的发现。

关于google-cloud-platform - Google Cloud Speech API 请求中出现错误,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/43260440/

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com