android - Making the Phone Constantly Listen for Voice Input -


i creating personal assistant application , want turn on voice recognition system (e.g. google voice keyboard) whenever set of words spoken, when application visible on device's screen. already-existent feature of samsung galaxy s3, can "unlock" if phone in lock state , phone unlock.

i don't know if voice recognition option this(e.g. keep mic on , start speech text when mic detects sound; therefore when user says keyword, device unlocks) believe should possible. worst case scenario can see being possible matching user's voice existent audio files - although wouldn't accurate speech text. therefore stt preference.

so question :

1) possible make phone constantly(even if application not displayed, root access not issue) listen voice recognition , execute line of code whenever set of words spoken? if so, how? keep in mind battery resources irrelevant in application.

you have write "speech recognizer" service , in service acquire wakelock. service code can find @ android speech recognition service on android 4.1 & 4.2


Comments