Android : constantly listen to input for speech recognition

1.6k views Asked by At

Here is the sample scenario :

App runs and user will talk. App will make some notification when the user mentions a predetermined word.

Something similar to "OK Google" : user can keep talking but nothing will happen until user says something related to google search.

I have considered using the MediaRecorder class (http://developer.android.com/reference/android/media/MediaRecorder.html) but the problem is that this records audio and saves it as a file. This would lead to saving every thing the user says as a file and then comparing it to the predetermined word. This is really inefficient and bad for a user's battery.

I need to be able to directly access the audio as it is coming to the microphone.

Is this possible?

Any help or examples will be appreciated. Please let me know if my question needs to be clarified in any way.

1

There are 1 answers

0
Peter Zaw On

Custom Google Now Voice Trigger - it may be the one you are after ...

The link is below ... I haven't tried it myself yet ...

http://lifehacker.com/how-to-create-custom-voice-commands-with-tasker-and-aut-1282209195

Please kindly tick "correct answer" if it is helpful ..