首页 > 解决方案 > 谷歌语音 API OGG_OPUS

问题描述

我尝试使用 Google Speech API 将音频文件转录为文本。我通过使用 .flac 文件来完成这项工作,但我还需要转换 .opus 文件。因为我后来在 Android 上,所以我无法将 .opus 转换为 .flac。以下配置适用于 flac 文件:

网址
POST https://www.google.com/speech-api/v2/recognize?key=123456&lang=de-DE

身体
data=file

标题
Content-Type=audio/x-flac; rate=48000

在随附的屏幕截图中,您可以看到我对邮递员的成功尝试:
1。

2.

在此处输入图像描述

我必须使用哪些 Content-Type 或其他设置来转录 ogg_opus 文件?如果我将 Content-Type 更改为“audio/ogg”,它就不起作用。

标签: google-speech-api

解决方案


推荐阅读