Android programming: voice recognition
I am looking to make a custom android app to help a physically disabled person. I need to rely heavily on voice recognition. The idea was as follows:
- the app (via voice recognition) receives its speech
- the application analyzes his speech and executes its commands ("email dad", "text fred", "what time?", etc., as well as other things that I will add to control his TV, lights, etc. ),
- after execution, the application waits for its next command (the loop returns to # 1)
I have # 1 and # 2 working fine, but I can't seem to find a good method for # 3. I can't leave the google voice info viewing undefined because it might be hours before the next command. But the "trigger" should be based on sound / voice. Must be completely free of hands.
Ideally, the app would just listen to the sound, and if that sound exceeds a certain pre-programmed decibel level, I would start to recognize the voice. Is it possible to continually loop through just listening to the noise and then react if it's so loud?
Any ideas?
thank
source to share
So the idea is that you want the voice recognition to continue. This is very difficult to do. But the way I have achieved this is to use:
try {
Thread.sleep(4500);
mSpeechRecognizer.startListening(mSpeechRecognizerIntent);
} catch (InterruptedException e) {
// It depends on your app logic what to do with InterruptedException
// You can process it or rethrow or restore interrupted flag
}
After onReady
(so if the user doesn't say something for about 4.5 seconds, it resets and on results. This works great for me.
source to share
CMUSphinx is a great solution for this:
- You can easily listen constantly, voice detection API is provided.
- You can improve accuracy for a custom instruction set
- You can adapt the model to the user's voice, which greatly improves accuracy.
For more information on using CMUSphinx on Android, see
http://cmusphinx.sourceforge.net/2011/05/building-pocketsphinx-on-android/
source to share