C o o p e r W i r i n g D e v i c e s
P a g e |
25
18), type the voice command to use to run the event, and specify whether the command
has to be spoken through a microphone or a telephone or either. Click the SAVE button to
save the changes to the event.
Command Syntax
Formatting Commands
There are some tricks you can use to format voice commands. For instance, say you would
like to give a command that changes your television to a specific channel. You could do this
by creating a voice command for every possible channel, but that is impractical. Instead, your
voice command can contain ranges of words. The recognition engine will accept any one of
the words. The command that will change your television to any channel would look like this:
TV channel (0|1|2|3|4|5|6|7|8|9)+
This configuration will accept any command like “tv channel 0 1”, or “tv channel 1 3 6”. You
can substitute the actual word for the number in the command like this:
TV channel (zero|one|two) etc.
It works the same either way.
Brackets are used for optional words such as:
[please] turn on the TV
The word “please” is optional and required to be spoken.
To have the TV voice command actually change a channel using an infrared command, you
will need a small script to convert the voice command to an infrared command. Run the
following script as an action to the event that contains the TV Channel voice command:
sub main()
dim s
' get the last voice command recognized
s=hs.lastvoicecommand
hs.SendIR "tv," & "$3,$4,$5"
end sub
The “$#” tell the system to substitute the proper voice command string into the infrared
command. In this case, the first channel number is at location 3 in the voice command. So
the first channel number will be inserted where $3 is located. Note that the voice
recognition system replaces numbers with their text equivalents, so you will need to name
your infrared keys with these names. For example, keypad number “1” should be defined
as “one”. This conversion can also be done in the above script if necessary.
NOTE: Nested parentheses “()” and brackets “[]” are not allowed. For example, the following
configuration will not work: (hello|(bill|sue))