1

I have an audio file (in .m4a / .wav format) stored on the Android device, and I need to transcribe the speech content from it into text.

From my understanding, the built-in SpeechRecognizer API in Android is mainly designed for live speech input via the microphone.

My questions are:

Is it possible to pass an existing audio file into Android’s SpeechRecognizer API to get the transcription?

If not, what would be the recommended way to transcribe pre-recorded audio files on Android?

Are there any open-source projects, libraries, or services that handle this use case (speech-to-text from audio file) directly on Android?

I would prefer solutions that can run on-device, but cloud APIs are also an option if there’s no native way.

1 Answer 1

0

Your android device does not do audio to text conversion itself, it has to connect to a third party service to do this. SpeechRecognizer is for spoken audio not a recording. For that the most promising api is google's speech to text. This uses google's own cloud service to translate audio to text. There is an explancation and a link to a tutorial on this page.

https://cloud.google.com/speech-to-text#transcribe-audio

Sign up to request clarification or add additional context in comments.

2 Comments

Actually I don't want to take audio using Speech Recognizer at first place. I have a setup in which I am taking the audio using mic doing AEC and noise cancellation. So I need to feed this audio to the speech recognizer instead of relying on SpeechRecognizer for the audio. Is there a way I can bypass this and pass audio data directly to speechRecognizer ?
All I can suggest is doing a search for audio to text projects. There is at least one on github called audio-converter-android

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.