Available in GitHub
Dealing with recognition events
In the apps presented in this chapter, we have coded a response only for some recognition events (onResults, onError and onReadyForSpeech). You can improve the examples by also considering the other events (onEndOfSpeech, onEvent, onPartialResults, and on RmsChanged).
In the apps presented in this chapter the recognition starts when a button is pressed. However, you may be interested in keeping you device continously listening and start recognizing when the user starts talking. In order to do this, you can use the code that you can find in gastlib.
This technique may introduce many errors, as the user may be talking to somebody else and not to the device. A trick to solve this situation is to use a command. For example, our library is called SANDRA (Speech ANDroid Apps), so the app could wait until the users says “Sandra” to start recognizing.
Greg Milette and Adam Stroud. Professional Android™ Sensor Programming, Wrox, 2012. Chapter 16 of this book covers ASR.
Reto Meier, Professional Android™ 4 Application Development, Wrox, 2012. Pages 439 to 441 present a brief discussion of ASR.
There are several tutorials on the web that show how to build a speech recognition app. These include:
James Elsey: Android – How to implement voice recognition, a nice easy tutorial. http://www.jameselsey.co.uk/blogs/techblog/android-how-to-implement-voice-recognition-a-nice-easy-tutorial/
Sue Smith (Mobile Tuts): Android SDK: Build a Speak and Repeat App. http://mobile.tutsplus.com/tutorials/android/android-sdk-build-a-speak-and-repeat-app/