Android and Me

Newest Phones

Android And Me RSS Widget

Cupcake Voice Recognition Now Available for Testing

Alex Byrnes on May 01 at 12:22 pm28 comments
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

Comment RSS28 Comments

  1. Taylor says:
    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.

  2. Thumb up Thumb down 0

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

  3. Gammax says:
    Thumb up Thumb down 0

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

  4. Rey says:
    Thumb up Thumb down 0

    Pretty cool !

  5. Mario says:
    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.

  6. marc says:
    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.

  7. cece says:
    Thumb up Thumb down 0

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

  8. Bryce says:
    Thumb up Thumb down 0

    Can this be tested on the emulator?

  9. Bryce says:
    Thumb up Thumb down 0

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

    • Alex Byrnes says:
      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.

  10. Yi Zhang says:
    Thumb up Thumb down -1

    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

  11. Sam says:
    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);

  12. Ariel says:
    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?

  13. Jim says:
    Thumb up Thumb down 0

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

  14. SDC says:
    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?

  15. matt wolfe says:
    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!

  16. riccio says:
    Thumb up Thumb down 0

    why can’t I download the file??

  17. Bodhi says:
    Thumb up Thumb down 0

    G2 in the UK “recognizer not present”. : (

  18. TATIF says:
    Thumb up Thumb down 0

    est ce que je peut le tester dans mon pc avant de tester dans le téléphone
    merci

  19. abdelatif says:
    Thumb up Thumb down 0

    je suis entrain de realiser une application pour programmer un clavier vocale (au lieu de tapper une lettre par exemple “A”, l’utilisateur va la dicter directement puis l’application doit reconnaitre la lettre ” A” puis elle sera afficher a l’ecran du smartphone ) = pour faciliter la saisie des sms; j’aimerai bien que je trouve un aide sur les api de reconnaissance et synthese voclae pour android.
    la deuxieme chose est : est ce que l’emulateur d’android prend en charge les applications de reconnaissance et synthese vocale;

    • abdelatif says:
      Thumb up Thumb down 0

      je suis entrain de realiser une application pour programmer un clavier vocale (au lieu de tapper une lettre par exemple “A”, l’utilisateur va la dicter directement puis l’application doit reconnaitre la lettre ” A” puis elle sera afficher a l’ecran du smartphone ) = pour faciliter la saisie des sms; j’aimerai bien que je trouve un aide sur les api de reconnaissance et synthese voclae pour android.
      la deuxieme chose est : est ce que l’emulateur d’android prend en charge les applications de reconnaissance et synthese vocale;

  20. sudheendra says:
    Thumb up Thumb down 0

    how do i download this ? there is no download link available here.

Leave a comment