Did you know that, since the last update to Google Search, developers have been able to utilize offline voice recognition? Previously, any non-system app that wasn't an IME (Input Method Editor) that hoped to recognize your voice without a web connection needed a rather kludgy typing overlay. Since the update though, apps can hear and interpret not just your words, but essentially any command that doesn't explicitly require web access.
Utter!, taking advantage of the new possibility, claims to have become the first app with working offline voice recognition for Android Jelly Bean. After reaching out to Ben Randall, the app's developer, we've got a clearer picture of what it used to take to recognize speech offline, and what has changed.
I had implemented my own keyboard and was switching between Google Voice Typing and the users default keyboard with an invisible edit text field and transparent Activity to get the input. Dirty hack!
This was the only way to do it, as offline Voice Typing could only be triggered by an IME or a system application (that was my root hack) . The other type of recognition API … didn't trigger it and just failed with a server error.
A lot of work wasted for me on the workaround! But at least I was ready for the implementation...
Randall went on to explain that Utter! now uses SpeechRecognizer, which has been updated allowing developers to use offline recognition in a range of applications, whereas Recognizerintent, the previous offline voice typing code, required a valid IME token.
Technical speak aside, Utter!'s implementation seems to work without a hitch. The app can do things like launch apps, place calls, send SMS messages, play music, and more just like it would if it were online. Of course, you'll need to have downloaded the relevant speech recognition files through Google's Search app.
If you're a developer looking to integrate offline voice recognition into your app, you can check out the SpeechRecognizer class here. If you're a regular user looking for a powerful, versatile voice assistant with new offline functionality, hit the widget below.
Thanks, Ben Randall