【问题标题】:API Google Speech to Text - mp3 fileAPI Google Speech to Text - mp3 文件
【发布时间】:2018-09-19 19:24:47
【问题描述】:

我能够使用链接 (https://cloud.google.com/speech-to-text/docs/async-recognize) 中包含的教程转录音频,但它仅适用于 WAV 格式的音频。我想让它与 MP3 或 M4A 格式的音频一起使用。

我已经测试了链接 (https://github.com/GoogleCloudPlatform/java-docs-samples/blob/master/speech/cloud-client/src/main/java/com/example/speech/Recognize.java) 中包含的所有可能性,并按照链接 (https://cloud.google.com/speech-to-text/docs/encoding) 中的指南进行操作

在 Google Cloud 主页上,语音 API 演示工具可让您发送 mp3 文件并进行转录。

我希望社区帮助我的请求以 mp3 格式转录超过 1 分钟的音频。

【问题讨论】:

    标签: google-speech-api


    【解决方案1】:

    感谢您的帮助。但让我换一种方式来解释。

    link 页面上,使用音频文件进行转录的方法。但是,在 GitHub 中提供的所有可能性中,它们都不能以 WAV 以外的格式转录音频。我的大部分文件都是 MP3 和 M4A 格式。

    我总是得到以下答案:

    Exception in thread" main "java.lang.IndexOutOfBoundsException: Index: 0 at java.util.Collections $ EmptyList.get (Collections.java:4454) at com.logusit.speech.speech.SpeechApplication.main (SpeechApplication.java:50)

    我相信问题出在 RecognitionConfig 中的 setEncoding 和 setSampleRateHertz 参数中。我找不到正确的 JAVA 设置来转录 WAV 以外的文件。

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 2019-05-14
      • 2019-10-20
      • 1970-01-01
      • 2012-10-04
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2018-03-24
      相关资源
      最近更新 更多