Android offline voice recognition with simple commands/vocabulary

syntagma picture syntagma · Apr 25, 2012 · Viewed 8.5k times · Source

I am looking for some library that would allow me to create an offline voice recognition inside my Android app. There will be simple vocabulary consisting of up to 15 short (one word) commands for my app. Response time is crucial in my case.

Is there any viable offline option (free & paid)? I am aware of offline version of Sphinx but will it be the option with fastest response (again, I only need my app to recognize few commands not the whole speech-to-text functionality)?

Answer

Jonathan Fretheim picture Jonathan Fretheim · Apr 25, 2012

I've had success using PocketSphinx for this type of application. I'd suggest building the PocketSphinx Demo app, use the online sphinx lmtool to build language model of your short list of commands and see if it meets your response time needs. If the onResults callback isn't fast enough, you can use the onPartialResults callback which returns almost immediately--that's what I do and I'm happy with the performance. The demo app has a little built-in timer in the UI, too.

If you use the online lmtool, you can just take the lm file and the dict file from what it produces, using those to replace the corresponding lm and dict files in the language model they point you to in the demo setup instructions.

It was a bit of a pain to get built, but it was my first time using the NDK, which was finicky.