如何为 Speech-to-text 启用 MP3 编码功能 API

How to enable MP3 encoding feature for Speech-to-text API

对于 Google Cloud Speech-to-text api,支持 MP3 的编码,但它处于测试阶段。如此处所述:

https://cloud.google.com/speech-to-text/docs/encoding

当我尝试发送编码设置为 MP3 的请求时,我收到错误响应 Invalid value at 'config.encoding' (TYPE_ENUM), "MP3"

我必须在某处启用此测试版功能吗?如果是这样,我在哪里可以做到这一点?

我认为识别配置有问题,设置正确的编码和采样率,参见Reference for mp3

您可能使用的是 v1 而不是 v1p1beta1,MP3 编码在 v1p1beta1 中。 Reference