Skip to content

malversoft/tasker.vcc

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

12 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Version: 1.0.1 Android: 5.0+ Tasker for Android: 5.9.3+ License: GPL 3

Tasker project: Voice Command Capture (VCC)

VCC is an Android Tasker project that allows to capture voice commands and dispatch them to other tasks to be processed. This includes the ability to intercept voice assistant commands.

For example, using this project you can capture into Tasker any commands you say to Google Assistant, even commands that contain parameters, without having to define Google Assistant routines, without the need to specify the "run in Tasker" integration, and without using the AutoVoice plugin.


Requirements

Installation and setup

To get started:

  1. Import the vcc project into Tasker.
  2. Configure the dispatch tasks.

If you want to intercept GoogleAssistant commands:

  1. Import the vcc_locale project into Tasker.
  2. Follow the related additional setup and configuration instructions.

Finally:

  1. Enable/disable the project profiles, depending on the command sources you want to intercept.
  2. Read the important notes section, as it also contains relevant setup information.

Configuration

Configuration variables can be set in the task VCC - Config - Dispatcher.

  • %cfg_dispatch_task

    This is an array of task names that you want the captured commands to be sent to.

    For example, you can specify several tasks to receive the captured commands by setting those tasks names in the variables %cfg_dispatch_task1, %cfg_dispatch_task2, ...

    You should specify at least one existing task.

    IMPORTANT: These tasks must be a bit cooperative.

    • The called task receives the captured command as first parameter %par1.

    • The called task MUST return a value of 1 to signal that it recognized the command passed to it, and otherwise return 0 or nothing. There is no other way for the dispatcher to know if a command has been recognized or not and act accordingly.

  • %cfg_dispatch_multiple

    This is a boolean value that determines if a captured command will be processed by one or more tasks.

    If you specify a value of 0 (this is the default) the dispatcher will stop as soon as a task recognizes a command, so that captured command will not be sent to the rest of tasks.

    A value of 1 means that the captured command will be sent unconditionally to all configured tasks.

If you need clarification on topics like how to set a variable, manage task parameters or return a value from a task, etc., please refer to the Tasker documentation.

Command sources

Intercepting one command source or another is optional. You can set up which ones to intercept using the project profiles.

The next command sources can be intercepted:

Tasker voice command

You can explicitly input a voice command and dispatch it.

No profile is involved. Just create a shortcut to the VCC - Capture - Voice task in your device desktop.

Every time you run this task, Tasker will ask you for a voice command to dispatch.

Assistant Action command

Enable the VCC - Intercept - Assistant Action profile.

You can then capture and dispatch voice commands by saying:

"Hey Google, run <YOUR-COMMAND-HERE> in Tasker"

AutoVoice command

Enable the VCC - Intercept - AutoVoice profile.

You can then capture and dispatch voice commands by saying:

"Hey Google, ask AutoVoice to <YOUR-COMMAND-HERE>"

AutoWear command

Enable the VCC - Intercept - AutoWear profile.

You can then capture and dispatch commands sent from your wearable device to Tasker using AutoWear.

Google Assistant command

Enable the VCC - Intercept - Google Assistant profile.

You can then capture and dispatch voice commands by saying:

"Hey Google, <YOUR-COMMAND-HERE>"

Additional setup and configuration

Intercepting a Google Assistant command works by continuously checking the texts displayed in the Google Assistant window while it is opened. But these texts are localized in your system´s language, so to achieve this some additional setup and configuration is required.

  • Import into Tasker the additional vcc_locale project.

    This additional project defines the text patterns used by VCC to recognize when the Google Assistant is opened and when it does or does not contain any command to capture.

    A task is defined for every supported language. If your language is not supported yet, you should create a task specific for your language (use the ones in other idioms as a guide). You can then send it to the project developer to make the list of supported languages grow.

    These text patterns are subject to changes if the Google Assistant interface changes, so they are maintained apart from the rest of the project.

  • Configuration variables can be set in the task VCC - Config - Google Assistant.

    • %cfg_locale_force

      VCC does its best to determine the locale that is being used to display Google Assistant messages. If that fails, you can bypass the locale detection by specifying your language locale in this variable.

    • %cfg_locale_default

      If your locale is not supported yet, VCC will try to check the texts in Google Assistant window using this default locale, if specified.

    • %cfg_check_interval

      While Google Assistant is opened, VCC will periodically check for a command to capture. This variable defines the number of seconds between checks (by default will check every 1 second).

    If you need clarification on topics like how to set a variable, please refer to the Tasker documentation.

Notes on Google Assistant interception

  • Please note that intercepting and capturing a command from the Google Assistant visual interface does not prevent Google Assistant from also processing it.

    For example, if you say a command like "Hey Google, turn down volume" the command will be intercepted and dispatched, but the Google Assistant will ALSO turn down the volume in your device.

  • Only voice commands said to Google Assistant in the device where Tasker is running will be captured. Google Home or other assistant gadgets are not supported.

  • As the voice command is captured when displayed on screen, the device should be unlocked for the capture to work. If you want the capturing to be permanently available, you should prevent device locking using a feature like "do not lock while charging" or "do not lock while at home" in your device.

Important notes

  • AutoInput requires to be enabled as an Android accesibility service to be able to check for texts shown in Google Assistant.

    You can enable it by opening AutoInput and pressing the "Accesibility" option.

    Beware that some Android flavors eventually disable some accessibility services for no clear reason.

  • When used by VCC, AutoInput shows error notifications in the Android notifications bar when it detects that Google Assistant has been closed (something that is necessary). To get rid of those unwanted notifications there are two options:

    • Disable AutoInput error notifications. To achieve this open AutoInput, and under "Logs" configuration deactivate the option "Action Error Notifications".

    • Enable the VCC - Aux - AutoInput error profile in Tasker. This will require that you have the AutoNotification plugin for Tasker installed.

  • The system language detection may be imprecise if you have more than one locale language installed in your Android device. If you find that the texts in your language are defined but VCC is not using them, try to force the language locale used by VCC using the configuration variables set in the VCC - Config - Google Assistant task.

  • If VCC stops capturing commands, check that your Android battery saver is not killing any of the programs required for VCC to work. That includes Tasker and all plugins involved in the process.

  • In configuration variables and task names, locales are specified following the ISO 639-1 standard. For example, "en" stands for any engilsh variant, "en-US" for the USA english variant, "es" stands for any spanish variant, "es-ES" for the Spain spanish variant, and so on.

About

Capture voice commands using Tasker.

Topics

Resources

License

Stars

Watchers

Forks

Packages

No packages published