Android 1.1 was released this week and included a voice search application as part of the update. Like most parts of Android the speech recognition functionality has been abstracted into sub tasks that use intents to perform specific actions. You can now call an intent that will launch the speech recognizer “application” and return to your application a list of results. The Intent and a description of it’s results can be found in the Android source code in the android.speech package. This library is not officially supported by the Android SDK and it should not be used in any consumer facing applications. That said you should also make sure to include “
Here is the code for launching a simple speech recognition intent:
Intent intent = new Intent("android.speech.action.RECOGNIZE_SPEECH");
startActivityForResult(intent, 0);
The intent launches the voice recognition activity which prompts the user to speak into the phone, your speech is then analyzed and a list of results is returned in a bundle to your activity.
Here is the code for extracting the results:
@Override
protected void onActivityResult(int requestCode, int resultCode, Intent data) {
...code for checking resultCode and data intent...
ArrayList<String> results = data.getExtras().getStringArrayList("results");
}
As you can see this makes it very easy to add a speech recognition element to an application, although I am not sure whether or not this functionality will be officially supported in a future version of the SDK.




Great example! This is exactly what I needed.
Does this use google voice/talk (I forget which ) and what is your opinion on the feasibility of getting away from using googles online speech to text processing engine. Instead running recognition solely on the device which could allow gradual recognition improvement via pattern database population?
Colin
This uses the Google speech recognition service, which uses Google’s server-side speech processing. Android 2.1 actually integrates this whole process into all text fields but it still uses the server side element. I believe the server side is actually licensed from Nuance or one of those other speech recognition companies, this(licensing) would be why they don’t want to include it on the client side more than likely.
Your idea could work. You would want to do all of the speech analysis using the NDK, the problem with that is that as far as I can tell you can’t access any of the database API from the NDK so you would have to call back into java side to populate the database, also I imagine the database would be fairly large so you would want it on the SD card.
Is their any way you could publish your source code for that hippo program. I am having the hardest time comparing the results to a string.
Thanks!!
Hi,
I want to develop a complete Speech to Text conversion application for android.
User can speak in English, Chinese, Japanese.
Any guidance will be highly appreciated.
Thank you
Regards,
Jeetendra
Hi,
it’s possible have the entire code for the example above?
How can I manage the resul?