Source: http://lifehacker.com/how-to-create-custom-voice-commands-with-tasker-and-aut-1282209195
Google Now already has a ton of useful voice commands built in
For this guide, we're going to be using Tasker and AutoVoice primarily, focusing on the new UI
(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:
- Open your phone's Settings app.
- Tap "Accessibility."
- Tap "AutoVoice Google Now Integration."
- Tap the toggle at the top of the screen.
- 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:
- Open Tasker.
- Tap the plus sign at the bottom of the screen.
- Select Event.
- Under "Plugin," choose "AutoVoice Recognized."
- Tap the edit button next to "Configuration."
- 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.
- Tap the check mark at the top of the screen.
- 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.
- Create a new task under Tasks.
- Give your task a name (i.e. Text NAME)
- Tap plus sign to add a new action.
- Tap "Phone."
- Select "Send SMS."
- Enter a phone number and a pre-set message.
- Optional: Check "Store in messaging app" if you'd like to keep a record of sent messages.
- Tap the back button at the top left.
Change multiple settings in a single set.
- Create a new task under Tasks.
- Name it (i.e. Home Settings)
- Tap plus sign to add a new action.
- Tap "Net" and select WiFi.
- Choose "On" under "Set."
- Tap "Net" and select "Bluetooth."
- Choose "Off" under "Set."
- Tap "Misc" and select "GPS."
- Choose "Off" under "Set."
- Tap the back button at the top left.
- 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
Photo mixed from Vivaporius.