

Mp.setDataSource(file) // here file is the location of the audio file you wish to use an input code for playing the audio file which you wish to give as an input GetString(R.string.speech_not_supported), StartActivityForResult(intent, REQ_CODE_SPEECH_INPUT) Intent.putExtra(RecognizerIntent.EXTRA_PROMPT, Intent.putExtra(RecognizerIntent.EXTRA_LANGUAGE, Locale.getDefault()) RecognizerIntent.LANGUAGE_MODEL_FREE_FORM) Intent.putExtra(RecognizerIntent.EXTRA_LANGUAGE_MODEL, Intent intent = new Intent(RecognizerIntent.ACTION_RECOGNIZE_SPEECH)

Free google speech to text app android android#
It is currently not possible to send your own audio file to google for processing but instead you can use your speaker and microphone in your android device to use your audio file as an input to google voice recognition.įirst you must have an audio file which may be in your SD card then use the following steps:Ģ) within that method first write code for using google speech recognitionģ) Following that code write the code for using speaker to play your audio file which will then become as an input to google speech recognition //code for google voice recognition If someone needs more information about it, let me know cause I'm not able to put more than 2 links in this post. I left one key in that project just to show it's working, but I'll remove it eventually. In order to make it work in a different scenario, it's necessary to get a Google Speech API key, which is obtained by being part of Google Chromium-dev group. The project I created has the basic principles to make it work and can be improved for specific situations. Thus, it's possible to record a flac sound, send it to Google Speech API, get the text, and play the sound that was just recorded. AudioBoo uses native code to record and play flac format. I implemented Flac recording in that project through extracting and adapting some pieces of code and libraries from an open source app called AudioBoo. That makes us to go to the second part: Flac recording However, this API needs to receive a FLAC sound file to work properly. What this means, is that it actually uses two HTTP connections- one POST request to upload the content as a “live” chunked stream, and a second GET request to access the results, which makes much more sense for longer audio samples, or for streaming audio." "(.) the new API is a full-duplex streaming API. Mike Pultz gives more details about the API: Google Speech API is called through HTTP connections.

I combined two features in that project: Google Speech API and Flac recording. I'm gonna try to explain briefly the approach I used. Also, I put some print screens inside the project to illustrate the app. Start speaking, and the phone will recognize your message. Here is the link to a simple Android project I created to show the solution's working. QUICK ANSWER To use voice-to-text on Android, open the keyboard in your chat or text app and tap the microphone icon. I got a solution that is working well to have speech to text from a sound file.
