Android Question Audio File to Text?

JohnC

Expert
Licensed User
Longtime User
What I am looking for is for a user to speak some words into a microphone, and I want to end up with an audio file of the user's recorded audio that they spoke and a *separate* text file of the words they spoke.

Right now, if you use androids/google's speech-to-text API, it streams the audio coming in on the devices microphone to google's servers, then google returns one or more strings of text it decoded from that audio. That gets me the text, but I also need the audio.

One solution is to simply record the users voice so I will have the audio file, then somehow send the audio from the file to google's servers instead of the audio coming from a live microphone. But, I can't seem to find a way to redirect the input stream to google's API so the audio comes from a file instead of the microphone?

Another solution would be to be able to record the audio to a file *while* it is also being streamed to googles servers as the user talks into the microphone. But I can find any way to "tap" into the microphone audio stream and split it into two streams: one going to a audio file and the other going out to google's servers.

Any help would be greatly appreciated.
 
Last edited:

JohnC

Expert
Licensed User
Longtime User
I will give that a shot - thanks Erel.
 
Upvote 0
Top