Android And Me - androidandme.com

Cupcake Voice Recognition Now Available for Testing

By Alex Byrnes on May 01 21

| More
Cupcake Voice Recognition Now Available for Testing

Since my last article on voice recognition in Cupcake, two things have happened. The Haykuro images came out and Google released the 1.5 SDK. That means it’s time to test out the voice recognition on a real phone. I’ve compiled some example code that comes with the SDK below. You can install it if you have the Cupcake over-the-air update, the 1.5 ADP, or a Haykuro image.

Voice Recognition for Android 1.5

Voice Recognition for Android 1.5

To install, look for Voice Recognition in the Market (Applications > Demo) or scan the QR code at the bottom of the post. Once it’s installed, you just push the button, speak into your phone and Google’s best guess appears on the screen. Very simple, but some pressing questions have been answered.

It looks like voice recognition will take this form for all applications. The application starts the voice recognizer which prompts the user, displays the volume widget, shows the waveform of the recording, and then returns the results to the application. It’s not perfectly seamless but it gets the job done in a fairly small amount of time.

Note that the processing is not CPU intensive on the phone, but it will need to be sent to Google to be turned into text (thanks to Tim H for pointing this out on the last article). You’ll need a good internet connection for this. I found EDGE (non-3G data connection) to be a bit unreliable. About half got sent back with a connection error. That will definitely vary, but the worst case scenario is not good, especially if you’re trying to use this for possibly frustrating operations like speaking commands to your GPS navigation system. WiFi works much better and the results are fast.

Voice Recognition Results

Voice Recognition Results

I like the fact that you get good feedback from the volume widget and the waveform as to how you should be speaking. Since it doesn’t adapt itself to your speaking patterns, you’ll have to accommodate it. Also, if you don’t have an American accent, you might have a tough time getting good results. But, it does work, and Google says it’s getting better with practice. And since Google is one of the few companies on Earth with billions of dollars and access to millions of people’s voice searches, I’d say they’ve got as good a chance as anyone of getting this right.

Internally, the voice recognition interface is pretty simple. Developers will get their choice of models, either free-form or web search based, and they get a list of possible results instead of just one. That allows them to implement their own language model. If three responses come back, the application can choose the one most fitting to its cause.

Suppose the application wants a simple “yes” or “no.” It could accept anything starting with a “Y” as yes and “N” as no. “Yup,” “Yeah,” “You betcha”… as well as “yurt,” “yam”, and “yaw” depending on who’s speaking and how Google interprets it. You’re almost guaranteed a good match. In fact, the smaller the search space, the greater the likelihood of a good match, so a yes/no could be simplified to a silence versus response scheme that would work in any language. (In my tests, “yes” worked pretty well, but “no” consistently came up with “snow.”)

The language model is set to free-form on the sample, so results should differ slightly from the regular voice search.

Good luck! If you have funny, interesting, insightful results, please post them here.

Voice Recognition Demo for Android
Version: 1.0
Developed By: Alex Byrnes
Price: FREE
Filesize: 0.11KB

About The Author

Subscribe

Alex Byrnes

Author info coming soon...

21 Comments

  1. Thumb up Thumb down 0

    I just downloaded it and played around for awhile. It will be cool once more apps start supporting this. I can’t wait to see how it is used for games.

    reply?
  2. Thumb up Thumb down 0

    Oh man. This actually works pretty well. Thanks for the article, I probably would’ve missed this otherwise.

    reply?
  3. Thumb up Thumb down 0

    something the ocean cant do, I cant wait for my g1

    reply?
  4. Thumb up Thumb down 0

    Pretty cool !

    reply?
  5. Thumb up Thumb down 0

    Hmm… doesn’t work on mine. UK Cupcake OTA updated, but might need a hard reset one of these days.

    reply?
  6. Thumb up Thumb down 0

    same here dutch g1 1.5 doesnt have the voice search(not on mine) so i guess thats why it doesnt work. weird that the us does have the voice search and mine doesnt.

    reply?
  7. Thumb up Thumb down 0

    In the french version neither. No api on the phone.that’s because for now only english is supported.

    reply?
  8. Thumb up Thumb down 0

    Can this be tested on the emulator?

    reply?
  9. Thumb up Thumb down 0

    So is English the only language that is supported right now?

    reply?
    • Thumb up Thumb down 0

      Yes English is the only supported language and I don’t think it’s being rolled out in the UK even though that would be an obvious next step. Handling different accents appears to be a big hurdle.

      reply?
  10. Thumb up Thumb down 0

    Hi Alex,
    As I searched in the SDK document of Cupcake, I only found several constants of android.speech. And as well I only found a built-in app VoiceDialer that uses android.speech. It seems that Google did not expose APIs for external developers. So how do you know the interfaces of android.speech and develop this app?

    Thanks,
    Yi

    reply?
  11. Thumb up Thumb down 0

    Actually according to the guys at 4feets.com you can narrow the results to specific answers. So if your app is waiting for a yes/no as a result (and you want to avoid “snow”) then the code would look like this:

    # public void startRecognition() {
    # // Set potential Results
    # ArrayList potentialResults = new ArrayList();
    # potentialResults.add(“yes”);
    # potentialResults.add(“no”);

    # // Create Intent
    # Intent intent = new Intent(“android.speech.action.RECOGNIZE_SPEECH”);
    #
    # // Settings
    # intent.putExtra(“android.speech.extra.LANGUAGE_MODEL”, “free_form”);
    # intent.putExtra(“android.speech.extra.PROMPT”, “Speak now”);
    # intent.putExtra(“android.speech.extra.RESULTS”, potentialResults);

    reply?
  12. Thumb up Thumb down 0

    I downloaded it and installed it today. I’m using a G2 carried by Rogers in Montreal, Canada. When I open the app, it says: “This activity demonstrates the voice recognition APIs.” and under that: “Recognizer not present.”

    What do I need to do for it to work?
    This phone came with the 1.5 version stock… Do I need to update anything?

    reply?
    • Thumb up Thumb down 0

      I too see “recognizer not present”.

      I am running voicerecognizer.java
      from
      developer.android.com/

      Why does it say “recognizer not present”. I guess I will have to single step thru it, ugh.

      Cheers!
      speedup@wikispeedia.org
      jim

      reply?
  13. Thumb up Thumb down 0

    Could you make it copy the text to the clipboard for later pasting?

    reply?
  14. Thumb up Thumb down 0

    This tool doesn’t work in Canada for whatever, clearly inane, reason!

    You will get the ‘recognizer not present’ error if you try to use it.

    Can anyone explain why the recognizer is not available on Canadian phones?

    reply?
  15. Thumb up Thumb down 0

    also wondering why there is no voice recognicion in canada…first no toutchscreen keyboard and now no voice recognition. not to mention crummy service…man rogers blowz!

    reply?
  16. Thumb up Thumb down 0

    why can’t I download the file??

    reply?

Leave a comment

Android And Me RSS Widget Android Network Awards