2
votes

I was able to transcribe an audio using the tutorial contained in the link (https://cloud.google.com/speech-to-text/docs/async-recognize), but it only works with audio in WAV format. I would like to make it work with audio in MP3 or M4A format.

I've already tested all the possibilities contained in the link (https://github.com/GoogleCloudPlatform/java-docs-samples/blob/master/speech/cloud-client/src/main/java/com/example/speech/Recognize. java) and follow the guidelines in the link (https://cloud.google.com/speech-to-text/docs/encoding)

On the Google Cloud home page, the Speech API demo tool lets you send an mp3 file and the transcript takes place.

I would like a community help for my request to transcribe an audio with more than 1 minute in mp3 format.

1

1 Answers

2
votes

Thank you for your help. But let me explain it in a different way.

On the link page, ways to use an audio file to do the transcription. However, in all possibilities presented in GitHub, none of them could transcribe an audio in a format other than WAV. Most of my files are in MP3 and M4A.

I always get the following answer:

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)

I believe the problem is in the RecognitionConfig in the setEncoding and setSampleRateHertz parameters. I can not find the correct JAVA setting to transcribe a file other than WAV.