Author Topic: Change command depending on what words spoke  (Read 1173 times)

0 Members and 1 Guest are viewing this topic.

SteveB69

  • Contributor
  • ***
  • Posts: 72
  • Karma: -1
    • View Profile
Change command depending on what words spoke
« on: December 22, 2015, 08:44:04 PM »
So just watching the VoxCommando Tutorial 1A Editing and Building  tutorial & I note you can put a 2nd phrase in that must be either spoken or toggled to optional. So wondering what the point of this feature is?

Unless by using the optional phrase one can get VC to do something different than if the optional phrase isn't spoke.

So if I say what time is it, VC will say that, if I say what time is it Please, VC will add a more personal reply to the time?

I've put what I've one below, can anyone help please?

Code: [Select]
<?xml version="1.0" encoding="utf-16"?>
<!--VoxCommando 2.2.0.9-->
<command id="461" name="Time" enabled="true" alwaysOn="False" confirm="False" requiredConfidence="80" loop="False" loopDelay="0" loopMax="0" description="Simple command to retrieve time and date and announce with a respective flare.">
  <action>
    <cmdType>TTS.SpeakSync</cmdType>
    <params>
      <param>{DtCustom.h:mmtt}</param>
    </params>
    <cmdRepeat>1</cmdRepeat>
  </action>
  <if ifBlockDisabled="False" ifNot="False">
    <ifType>(A)==(B)</ifType>
    <ifParams>{1}&amp;&amp;Please</ifParams>
    <then>
      <action>
        <cmdType>TTS.Speak</cmdType>
        <params>
          <param>OK Steve</param>
        </params>
        <cmdRepeat>1</cmdRepeat>
      </action>
    </then>
    <else />
  </if>
  <phrase>What is the time, what's the time, what time is it</phrase>
  <phrase optional="true">Please</phrase>
</command>
Chances are I've searched the forum, searched the wiki & scoured You Tube but I'm just to thick to work it out without help!

jitterjames

  • Administrator
  • Hero Member
  • *****
  • Posts: 7714
  • Karma: 116
    • View Profile
    • VoxCommando
Re: Change command depending on what words spoke
« Reply #1 on: December 22, 2015, 08:58:23 PM »
Optional phrases are simply there to give you more flexibility about how you want to say a command.  You might want to be able to say either "turn the light on" or "turn light on".  If you want different things to happen when you say different things, then you must either create multiple commands or use payloads.

SteveB69

  • Contributor
  • ***
  • Posts: 72
  • Karma: -1
    • View Profile
Re: Change command depending on what words spoke
« Reply #2 on: December 22, 2015, 10:05:38 PM »
Quote
turn the light on" or "turn light on
Sorry but that doesn't explain the point of optional phrases, isn't it easier to just have the phrases you will say?

Quote
If you want different things to happen when you say different things, then you must either create multiple commands or use payloads.
Is there a tutorial, guide to explain & set up a payload, I've watched the ones on You Tube re volume adjustment but haven't found anything where I can make VC respond differently if a different phrase is used?
I did watch one of Kalles videos on YT but he didn't go into detail re the specifics & I'll start another topic on that.
Chances are I've searched the forum, searched the wiki & scoured You Tube but I'm just to thick to work it out without help!

nime5ter

  • Administrator
  • Hero Member
  • *****
  • Posts: 1999
  • Karma: 61
    • View Profile
    • Getting Started with VoxCommando
Re: Change command depending on what words spoke
« Reply #3 on: December 22, 2015, 10:22:25 PM »
Sorry but that doesn't explain the point of optional phrases, isn't it easier to just have the phrases you will say?

If you install one of the standard configurations -- which is what our "getting started" documentation suggests new users should always begin with, rather than installing the Basic configuration -- you will see various commands, where it should be fairly clear why optional phrases can be useful.

That said, you don't need to use optional phrases. It's an option. If you don't want to have optional phrases -- that is, phrases that VC will understand if you say them, but which are not *required* for the command to be executed -- then don't create commands that use optional phrases.

Regarding whether there are tutorials on payloads:

There is a ton of information on payloads. Start with the wiki.

http://voxcommando.com/mediawiki/index.php?title=Payloads

Also, on the forum board called Tutorials there is a stickied thread that is called:

NEW USERS: Payloads -- what are they and how do I use them?

Also, both tutorials 1A and 1B go into great detail about all the different kinds of payloads.

A bunch of other video tutorials also demonstrate how to use payloads.
TIPS: POST VC VERSION #. Explain what you want VC to do. Say what you've tried & what happened, or post a video demo. Attach VC log. Link to instructions followed.  Post your command (xml)