Toggle Google Now voice search hotword detection?

903 views
Skip to first unread message

Mark S

unread,
Apr 4, 2014, 10:01:51 PM4/4/14
to tas...@googlegroups.com
Long time Tasker user here and I have a question...

Background: I leave my smartphone on it's charger and awake at the GEL home screen during my workday.  I pick up a lot of false positives generated by ambient conversation that trigger the "OK Google" hotword detection and launch the Google Now voice search.  

Question: Is it possible to create a Tasker task to turn off/on the "OK Google" hotword detection setting that is found under Google Now > Settings > Voice?  I already have an "At Work" profile that I could use to execute the task, if one could be created.


Thanks,
Mark 

Brandon Horwath

unread,
Apr 5, 2014, 2:47:56 PM4/5/14
to tas...@googlegroups.com
Rooted device?

... if so, you could use input taps. But, it'd be slow.

Otherwise, I don't think so.

Unless, you disabled it permanently and used Tasker to set the initiation command to something other than 'OK Google'.

I have mine set to recognize 'droid' and launch that task like this...

Profile: # Droid REGEX (9)
State: AutoVoice Recognized [ Configuration:Command: "droid (regex)" ]
Enter: AV Droid Command (21)
A1: Send Intent [ Action:android.intent.action.WEB_SEARCH Cat:None Mime Type: Data: Extra:query:%avcommnofilter Extra: Package:com.google.android.googlequicksearchbox Class:com.google.android.googlequicksearchbox.SearchActivity Target:Activity ]

Hope that helps!

Mark S

unread,
Apr 5, 2014, 3:19:45 PM4/5/14
to tas...@googlegroups.com
Thanks for the reply Brandon.

Yes, this is on a rooted Nexus 4.

I agree doing it through taps would be slow/impractical and I don't want to change it permanently to a different verbal command; although that's not a bad last resort, I'd probably just live with the problem in its current state.

But the more I thought about this, I began wondering if there is some way to detect when the "listener" box pops up (the one with the red microphone, that takes the command AFTER "OK Google" is spoken) if I could somehow detect that as a context condition along with "At Work" and cancel the listener process...if that makes sense.  Or, I don't know the app package that the listener pop-up is a part of; but maybe I could just close that process whenever it is called to the foreground while I am at work?

Is something like that possible?

Brandon Horwath

unread,
Apr 5, 2014, 3:30:54 PM4/5/14
to tas...@googlegroups.com
Check the value of %WIN

I believe in your situation, it would match 'Google Voice', but I think it is slightly different if it uses an offline search, might be, 'Voice Search'.

Either way, check the value of %WIN

That should get you going.

Matt R

unread,
Apr 5, 2014, 3:31:38 PM4/5/14
to tas...@googlegroups.com
Try using the %WIN variable to detect the pop-up.

Matt

Mark S

unread,
Apr 5, 2014, 3:47:05 PM4/5/14
to tas...@googlegroups.com
Good suggestions.  I tried checking what the WIN% variable gets set to when voice search activates by creating a profile that displays a pop up with the value of WIN% any time it gets set, but it doesn't appear to get set when the voice search is invoked.  :(

As I navigate around, I get the pop-ups telling me as WIN% is set to "Home", "Recent Apps", "Notification Shade", etc., ...but nothing for the Google voice search listener, maybe because it is part of Home now?

Am I missing something or are there any other ideas?

Brandon Horwath

unread,
Apr 5, 2014, 4:42:16 PM4/5/14
to tas...@googlegroups.com
After testing I found the same. The red mic window isn't recognized. I could swear I remember at one time it was. Guess that's the problems with updates.

... I'm at a loss.

Matt R

unread,
Apr 5, 2014, 6:13:44 PM4/5/14
to tas...@googlegroups.com
I wonder if you could find an app or plugin or something that can disable the microphone. Or maybe if you play a (silent) song? I think that prevents the microphone from detecting anything.

Matt

Mark Schyns

unread,
Apr 5, 2014, 6:52:34 PM4/5/14
to tas...@googlegroups.com

Not a bad idea, I'll see if I can do something like that (tomorrow, finalfour today).

On Apr 5, 2014 6:13 PM, "Matt R" <matthew.r...@gmail.com> wrote:
I wonder if you could find an app or plugin or something that can disable the microphone. Or maybe if you play a (silent) song? I think that prevents the microphone from detecting anything.

Matt

--
You received this message because you are subscribed to a topic in the Google Groups "Tasker" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/tasker/LJANfhoVodE/unsubscribe.
To unsubscribe from this group and all its topics, send an email to tasker+un...@googlegroups.com.
Visit this group at http://groups.google.com/group/tasker.
For more options, visit https://groups.google.com/d/optout.

Mark S

unread,
Apr 6, 2014, 9:03:42 AM4/6/14
to tas...@googlegroups.com
I've come up with a solution (more of a work-around) that uses one of the limitations of the Google Now voice search to incapacitate it using the Secure Settings plugin.  I've created a Secure Settings task which sets my locale as "English (India)" when my "At Work" profile is activated.  This is a language for which voice search does not offer the "OK Google" hotword detection, so in essence the hotword detection is turned off.  I can still tap the microphone and speak a command to Google Now...a benefit I would not get if I disabled the microphone entirely.  Plus it gives my Nexus 4 a sweet Indian accent when Google Now speaks back to me.  :-)

I've also created another task to set my locale back to "English (United States)" that I can trigger when exiting my "At Work" profile.

I'm not sure if switching languages will cause any other side effects on my smartphone...although I have noticed a craving for curry since making this change.  :-)

Thanks for the suggestions.

Brandon Horwath

unread,
Apr 6, 2014, 1:39:33 PM4/6/14
to tas...@googlegroups.com
Lmao...

Well, good. My complements on implementing such a creative solution. Nicely done!

Mark S

unread,
Jul 9, 2014, 11:28:31 AM7/9/14
to tas...@googlegroups.com
For anyone interested that happens upon this...

Apparently, Google has recently patched the Google Now voice search hotword to work for the English(India) locale so my hack is no longer working.  I am looking for other solutions.  Using Tasker to mute the microphone works, but I believe also would affect the mic if I were to make or receive a phone call.  I may be able to set up a second tasker profile when the Phone is active and have it unmute the mic.  Will try this and report back.

Jeremy Harris

unread,
Jul 9, 2014, 6:59:55 PM7/9/14
to tas...@googlegroups.com
I think you might be looking for this intent? Sorry, if not..

A4: Send Intent [ Action:android.intent.action.VOICE_COMMAND Cat:None Mime Type: Data: Extra: Extra: Package:com.google.android.googlequicksearchbox Class: Target:Activity ]

cerebralcow

unread,
Jul 28, 2014, 9:22:02 AM7/28/14
to tas...@googlegroups.com
The same thing happens to me when I have headphones or my car radio plugged in through the stereo jack. Muting the mic worked for me, thanks. :)

SportyRydr

unread,
Jul 29, 2014, 10:16:37 AM7/29/14
to tas...@googlegroups.com

I tried this too, and for me, the window label was Google. However, I am using Nova Launcher with its hotword detection feature, so don't know if that would make a difference...

Tyler Francis

unread,
Sep 5, 2014, 1:34:51 PM9/5/14
to tas...@googlegroups.com
First: sorry about this zombie post.
Second: how did you enable that toast notification to show you the value of %win? I've been looking around for a screen that'll list the current value of internal variables, but I can't find it because I'm an idiot.

Taster 4.4u3m
Rooted Android 4.4.4
Cyanogenmod 11-20140805-snapshot-m9-d2lte

Thanks.
Screenshot (12_31PM, Sep 05, 2014).png

Matt R

unread,
Sep 5, 2014, 2:06:52 PM9/5/14
to tas...@googlegroups.com
Make a new profile.  Event > Variable > Variable Set > %WIN.  In the task, add an action alert > flash > %WIN ...

Matt

Tyler Francis

unread,
Sep 5, 2014, 6:12:28 PM9/5/14
to tas...@googlegroups.com

BRILLIANT
it worked, thanks.

On Sep 5, 2014 1:07 PM, "Matt R" <matthew.r...@gmail.com> wrote:
Make a new profile.  Event > Variable > Variable Set > %WIN.  In the task, add an action alert > flash > %WIN ...

Matt

--
Reply all
Reply to author
Forward
0 new messages