Author Topic: Getting to grips with payloads, the human touch - Personalisation  (Read 2992 times)

0 Members and 1 Guest are viewing this topic.

SteveB69

  • Contributor
  • ***
  • Posts: 72
  • Karma: -1
    • View Profile
I'm trying to get VC to respond to a given name & respond, "Hello {1}" & then a custom reply for that name.

If I do this using a payload range then all works fine.

But if I do it using a payload.xml it doesn't work. Obviously because I am doing something wrong.
I have created an xml, attached, & in the phrase put the name of the person & in the value put out the text I would like read.

But can't figure out how to tell VC to do this. If I use only the payload.xml then nothing happens.

The code I've upped has a payload list & a payload range, currently the payload range works if I keep the payload xml disabled or optional.

Is there a way to do this via the payload xml as this would be easier for future lists than have to add a logic block for each individual name.

Any chance of a pointer to get me going?

(I did also try using a payload dictation regular but again got no joy & anyway this method would be a bit more hit and miss with the names heard.)

Code: [Select]
<?xml version="1.0" encoding="utf-16"?>
<!--VoxCommando 2.2.1.2-->
<command id="533" name="Say hello to {1}" enabled="true" alwaysOn="False" confirm="False" requiredConfidence="0" loop="False" loopDelay="0" loopMax="0" description="">
  <if ifBlockDisabled="False" ifNot="False">
    <ifType>(A)==(B)</ifType>
    <ifParams>{1}&amp;&amp;tony</ifParams>
    <then>
      <action>
        <cmdType>TTS.Speak</cmdType>
        <params>
          <param>Ahh, hello {1}. It is my pleasure to make your acquaintance</param>
        </params>
        <cmdRepeat>1</cmdRepeat>
      </action>
    </then>
    <else />
  </if>
  <if ifBlockDisabled="False" ifNot="False">
    <ifType>(A)==(B)</ifType>
    <ifParams>{1}&amp;&amp;steve</ifParams>
    <then>
      <action>
        <cmdType>TTS.Speak</cmdType>
        <params>
          <param>Ahh, hello {1}. It is my pleasure to make your acquaintance</param>
        </params>
        <cmdRepeat>1</cmdRepeat>
      </action>
    </then>
    <else />
  </if>
  <if ifBlockDisabled="False" ifNot="False">
    <ifType>(A)==(B)</ifType>
    <ifParams>{1}&amp;&amp;karyn</ifParams>
    <then>
      <action>
        <cmdType>TTS.Speak</cmdType>
        <params>
          <param>Ahh, hello {1}. It is my pleasure to make your acquaintance</param>
        </params>
        <cmdRepeat>1</cmdRepeat>
      </action>
    </then>
    <else />
  </if>
  <phrase>Jenkins Say hello to</phrase>
  <payloadList>Steve, Karyn, Tony</payloadList>
</command>

Since typing the above I've tried using a payload get phrase but that's doing nothing on the Save & Execute, but here's the code for that, really not sure which way to go with this.

An example tied to two names would be brill???

Code: [Select]
<?xml version="1.0" encoding="utf-16"?>
<!--VoxCommando 2.2.1.2-->
<command id="533" name="Say hello to {1}" enabled="true" alwaysOn="False" confirm="False" requiredConfidence="0" loop="False" loopDelay="0" loopMax="0" description="">
  <action>
    <cmdType>PayloadXML.GetPhrase</cmdType>
    <params>
      <param>D:\VoxCommando\payloads\sayhelloto.xml</param>
      <param>{1}</param>
    </params>
    <cmdRepeat>1</cmdRepeat>
  </action>
  <action>
    <cmdType>TTS.Speak</cmdType>
    <params>
      <param>{LastResult}</param>
    </params>
    <cmdRepeat>1</cmdRepeat>
  </action>
  <phrase>Jenkins Say hello to</phrase>
  <payloadList>Steve, Karyn, Tony</payloadList>
  <payloadFromXML phraseOnly="False" use2partPhrase="False" phraseConnector="by" Phrase2wildcard="anyone" optional="True">payloads\sayhelloto.xml</payloadFromXML>
</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!

PegLegTV

  • $upporter
  • Sr. Member
  • *****
  • Posts: 497
  • Karma: 43
    • View Profile
Re: Getting to grips with payloads, the human touch - Personalisation
« Reply #1 on: January 04, 2016, 10:50:21 PM »
Try this out and see if this works for you, it's using the same payload "sayhelloto.xml" that you posted,

I tested by saying "jenkins say hello to steve" and jenkins say hello to Tony" and both worked great

Code: [Select]
<?xml version="1.0" encoding="utf-16"?>
<!--VoxCommando 2.2.1.4-->
<command id="547" name="Say hello to {1}" enabled="true" alwaysOn="False" confirm="False" requiredConfidence="0" loop="False" loopDelay="0" loopMax="0" description="">
  <action>
    <cmdType>TTS.Speak</cmdType>
    <params>
      <param>{1}</param>
    </params>
    <cmdRepeat>1</cmdRepeat>
  </action>
  <phrase>Jenkins Say hello to</phrase>
  <payloadFromXML phraseOnly="False" use2partPhrase="False" phraseConnector="by" Phrase2wildcard="anyone" optional="True">payloads\sayhelloto.xml</payloadFromXML>
</command>

SteveB69

  • Contributor
  • ***
  • Posts: 72
  • Karma: -1
    • View Profile
Re: Getting to grips with payloads, the human touch - Personalisation
« Reply #2 on: January 04, 2016, 11:24:08 PM »
Absolutely brillo PegLeg, I thought it would be a lot more complicated than a TTS command followed by a {1}
Thanks for 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: Getting to grips with payloads, the human touch - Personalisation
« Reply #3 on: January 05, 2016, 09:51:40 AM »
In your initial post, your first voice command should have worked for you (although it could be done more simply, as PegLegTV shows).

The real question is: how were you testing your commands?

Apart from getting comfortable with how payloads and variables work, it's important to remember that when testing commands that use payloads, you can't just test using "Save and execute". You have to provide the command with the correct payload values somehow.

The only way to truly test them is to save and exit the tree, and then issue the voice command.

The second command failed because of a number of misconceptions. You're trying to learn and do a lot of different things very quickly, so I don't want to overload you here.

But basically, you're still not understanding payloads and payload XML, so you might want to re-visit the first two tutorial videos and then take another look at your commands to try to diagnose what's happening.

Most of the things you're asking about on the forum are discussed in the first two command editing video tutorials (even if the interface has changed).

Even if you watched them previously, now that you're more familiar with VC these videos should be easier to follow and learn from.

The first video can be started around the 6m mark in order to bypass the basics:
&feature=youtu.be&t=6m05s.
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)

SteveB69

  • Contributor
  • ***
  • Posts: 72
  • Karma: -1
    • View Profile
Re: Getting to grips with payloads, the human touch - Personalisation
« Reply #4 on: January 05, 2016, 09:28:21 PM »
Thanks nime5ter, yes will go back & re-watch the videos.
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!

SteveB69

  • Contributor
  • ***
  • Posts: 72
  • Karma: -1
    • View Profile
Re: Getting to grips with payloads, the human touch - Personalisation
« Reply #5 on: January 08, 2016, 10:31:48 PM »
I have an audio track which starts & the VC does some TTS stuff.

The audio track is longer than the TTS phrase & because the TTS length differs depending on the payload read out the audio can't be set to a specific time.

Is there a way to stop the audio when the TTS finishes, & also doing a fade out. I can use set.volume to do the fade & then set.volume to bring back to whatever level it was last at, which may be a bit awkward.
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!

Kalle

  • $upporter
  • Hero Member
  • *****
  • Posts: 2320
  • Karma: 47
    • View Profile
Re: Getting to grips with payloads, the human touch - Personalisation
« Reply #6 on: January 09, 2016, 05:21:42 AM »
I can only guess for what you looking for, because you did not post your command.


You can use "TTS.SpeakSync" action followed by an action to stop the audio. With TTS.SpeakSync action VC will wait until speaking is complete before continuing to the next action.
If you use MediaMonkey or Kodi to play your audio, there is a softmute and softunmute action available (fade out/fade in).
***********  get excited and make things  **********