Thursday, July 31, 2014

How to Create a Custom Google Now Command for Anything on Android

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

How to Create a Custom Google Now Command for Anything on Android

Google Now already has a ton of useful voice commands built in. Thanks to a recent update to Tasker plugin AutoVoice, though, you can now create your own commands that plug directly into Google Now to accomplish anything that Tasker can do with nothing but your voice.

For this guide, we're going to be using Tasker and AutoVoice primarily, focusing on the new UI. If you don't already have either of these apps, they're certainly worth paying the few bucks for. Not that you needed to be told that. You guys love Tasker. So, let's get started.

(Optional) Step 0: Get Ok, Google (If You Haven't Already)

One of the coolest features Google has introduced lately is the ability to launch voice commands without minimal non-voice input. If you're using a phone like the Moto X, you can already say "Ok, Google Now" to launch voice commands. If you're not, here are some of the ways you can get it:

  • Use the Google Now launcher (on certain devices): One of the headlining features of the Nexus 5 when it came out was that you could say "Ok, Google" from the lock screen. This has since been expanded to several other devices, though it's unclear how many are supported. To make matters more complex, Google has added an "Ok, Google" everywhere option that lets you launch voice commands even when you're not at the home screen. This is also only supported on a limited number of devices and it's unclear how (or if) the rollout is happening. Still, if you're one of the lucky ones that this works for, it's a great option.
  • Use an alternative launcher like Apex: Not content to wait for Google's rollout, some developers like Apex have added their own "Ok, Google" hotword detection. This allows you to launch voice commands from the home screen, even if you're not using Google's software.
  • Use a third-party always-listening app like Open Mic+: If you really want the full range of Moto X-style control, Open Mic+ can help. This app keeps your microphone open listening for "Ok, Google" no matter where you are in the app. The downside to this is that it can drain your battery, but the benefits may outweigh the costs for some people.

Obviously, none of these are a perfect solution for all devices. We're still a ways off from being able to launch all voice commands entirely hands-free in all situations on all devices. However, there are at least a couple options for most people.

This step is also entirely optional. Most devices have a voice button in the default Google search bar, and you can tap that and speak to send a voice command. Even if you can't trigger voice search without touching your device, it's one tap on most home screens to get started.

Step 1: Allow AutoVoice to Listen for Google Now Commands

AutoVoice "integrates" with Google Now by listening for specific searches. Just like with Google's built-in commands, if a particular search matches a Tasker profile you've set up, AutoVoice will intercept the search and run your custom command instead. If neither AutoVoice nor Google recognize it as an instruction, it will conduct a regular search.

Before you can do this, however, you need to enable the AutoVoice accessibility service. To do that, first install Tasker and AutoVoice (if you haven't already) and do the following:

  1. Open your phone's Settings app.
  2. Tap "Accessibility."
  3. Tap "AutoVoice Google Now Integration."
  4. Tap the toggle at the top of the screen.
  5. In the dialog that pops up, tap "OK."

This service may be in a different place in the Settings app, depending on your device. Once the listening service is enabled, you can start creating your own custom voice commands.

Step 2: Create a Custom Google Now Voice Trigger

With the new Google Now integration, creating a custom AutoVoice command is a drastically simpler process. AutoVoice recognizes commands separately and passes them to Tasker with the AutoVoice Recognized event. You can then attach any action to that Event. To create a custom voice command follow these steps:

  1. Open Tasker.
  2. Tap the plus sign at the bottom of the screen.
  3. Select Event.
  4. Under "Plugin," choose "AutoVoice Recognized."
  5. Tap the edit button next to "Configuration."
  6. Either tap "Command filter" to type in the voice command you want to trigger the event, or tap "Speak filter" to say it aloud. The latter helps make sure Google will recognize it correctly, so we recommend that first.
  7. Tap the check mark at the top of the screen.
  8. Tap the left caret at the top left of the screen to save the Event.

This will create a custom voice Event that will be recognized when you say it aloud within Google Now. The next step will be to create a Task that will be activated when Google Now/AutoVoice recognize your command. At this point, the sky's the limit.

Step 3: Tie Your Commands to the Immense Power of Tasker

From here, you'll be prompted either to create a new task or choose from an existing one. A world of possibilities is open to you at this point, and it would be outside the scope of this article (or an entire site) to fully explore. However, here are some examples to get you started.

Send a canned text message to a contact.

  1. Create a new task under Tasks.
  2. Give your task a name (i.e. Text NAME)
  3. Tap plus sign to add a new action.
  4. Tap "Phone."
  5. Select "Send SMS."
  6. Enter a phone number and a pre-set message.
  7. Optional: Check "Store in messaging app" if you'd like to keep a record of sent messages.
  8. Tap the back button at the top left.

Change multiple settings in a single set.

  1. Create a new task under Tasks.
  2. Name it (i.e. Home Settings)
  3. Tap plus sign to add a new action.
  4. Tap "Net" and select WiFi.
  5. Choose "On" under "Set."
  6. Tap "Net" and select "Bluetooth."
  7. Choose "Off" under "Set."
  8. Tap "Misc" and select "GPS."
  9. Choose "Off" under "Set."
  10. Tap the back button at the top left.
  11. Under the AutoVoice profile settings detailed in the, make sure "Event Behavior" is unchecked as mentioned above.

These are extremely basic examples, but part of the beauty of Tasker is that it can be extended to a huge number of tasks. As previously mentioned, you've already shared many of your Tasker actions, and if you have a home automation system, Tasker and AutoVoice can be used to create an impressive set of voice commands to control your entire home entertainment system with a little work. Tasker can be daunting, but this should at least help you get started with voice commands.

Photo mixed from Vivaporius.