Author Topic: Voxcommando and Denise (Guile3d) Help  (Read 12635 times)

0 Members and 1 Guest are viewing this topic.

ddl

  • Sr. Member
  • ****
  • Posts: 118
  • Karma: 0
    • View Profile
Voxcommando and Denise (Guile3d) Help
« on: January 14, 2016, 10:54:28 AM »
Hi,

Can someone help be understand why I am not getting a response when I try to initiate my VC with Guile3d (Denise)?  I have studied the sdk and have followed the instructions that was provided via this forum to make Denise work with VC. 

My main issue is that I am not able to see the Authkey when I test the command (http://127.0.0.1:8000/Kernel?function=AskAuthKey&Login=dodo&Password=dummy) in a web browser.  Nothing shows in the results. 

I had denise up and running on my computer when I tried the test and I have disabled my firewall and still no success.

Any thoughts on where I should begin to troubleshoot?  Is there a setting in Denise that I should have enabled/disabled in order to communicate with it via http?  Please advise.

 

Kalle

  • $upporter
  • Hero Member
  • *****
  • Posts: 2319
  • Karma: 47
    • View Profile
Re: Voxcommando and Denise (Guile3d) Help
« Reply #1 on: January 14, 2016, 11:47:13 AM »
try it with the IP of your computer on which Denise run.


for example: http://192.168.0.17:8000/Kernel?function=AskAuthKey&Login=dodo&Password=dummy


Which version of Guile3D did you use? I'm not sure if it will work with the standard version.
***********  get excited and make things  **********

ddl

  • Sr. Member
  • ****
  • Posts: 118
  • Karma: 0
    • View Profile
Re: Voxcommando and Denise (Guile3d) Help
« Reply #2 on: January 14, 2016, 12:06:39 PM »
Hi,

I tried using the ip address for my machine as well... still no success.  I am running the latest version of Denise platinum 1.9.

Kalle

  • $upporter
  • Hero Member
  • *****
  • Posts: 2319
  • Karma: 47
    • View Profile
Re: Voxcommando and Denise (Guile3d) Help
« Reply #3 on: January 14, 2016, 12:28:46 PM »
Take a look in the Guile3D folder on your maschine if it contain a folder which is named sdk and also if this sdk folder contain the guilesdk.js file - maybe it is not possible to get access to the api with this version.
***********  get excited and make things  **********

ddl

  • Sr. Member
  • ****
  • Posts: 118
  • Karma: 0
    • View Profile
Re: Voxcommando and Denise (Guile3d) Help
« Reply #4 on: January 14, 2016, 12:48:20 PM »
I have both of those files in my version of Denise.  Before purchasing the software I specifically ask if whether or not there would be access to the api with version 1.9.  They assured me that I would.  I have established a trouble ticket with  Guile3d and I'm waiting for a response.

Kalle

  • $upporter
  • Hero Member
  • *****
  • Posts: 2319
  • Karma: 47
    • View Profile
Re: Voxcommando and Denise (Guile3d) Help
« Reply #5 on: January 14, 2016, 12:51:50 PM »
If you take a look on their Forum - I think you will get not so fast a answer.


You can open the .js file in a text editor, maybe they have changed the command - I hope this will help you.


I have the old version of Denise and did never a update and it still works.
***********  get excited and make things  **********

ddl

  • Sr. Member
  • ****
  • Posts: 118
  • Karma: 0
    • View Profile
Re: Voxcommando and Denise (Guile3d) Help
« Reply #6 on: January 14, 2016, 01:29:05 PM »
ok, I think I figured out my mistake will try it in a few.  Essentially when I opened the .js file I did not edit anything.  I assumed that it was to show me an example of how the command should look.

function AskAuthKey(Login,Password){
  return call('/Kernel?function=AskAuthKey&Login='+Login+'&Password='+Password)

I did not edit the function to include my login and password in the file.  I only changed it in my http command when I entered it into the browser i.e
http://127.0.0.1:8000/Kernel?function=AskAuthKey&Login=dodo&Password=dummy

After rereading the instructions I believe I am supposed to edit the function text to include my username and password then save the .js file.  After that I am supposed to reboot and try the command again.  If my catch is correct then it should work when I place the command in the web browser.  Fingers crossed.

Kalle

  • $upporter
  • Hero Member
  • *****
  • Posts: 2319
  • Karma: 47
    • View Profile
Re: Voxcommando and Denise (Guile3d) Help
« Reply #7 on: January 14, 2016, 02:01:17 PM »
There is nothing to edit in the .js file  :o


Keep this js file untouched!
***********  get excited and make things  **********

ddl

  • Sr. Member
  • ****
  • Posts: 118
  • Karma: 0
    • View Profile
Re: Voxcommando and Denise (Guile3d) Help
« Reply #8 on: January 14, 2016, 02:07:04 PM »
Oh... Ok.  Then I'm lost.  I don't know what else could be the problem. 

Kalle

  • $upporter
  • Hero Member
  • *****
  • Posts: 2319
  • Karma: 47
    • View Profile
Re: Voxcommando and Denise (Guile3d) Help
« Reply #9 on: January 14, 2016, 02:24:08 PM »
did you tried this command group?


http://voxcommando.com/forum/index.php?topic=1650.msg14407#msg14407


try it also with a other browser.
***********  get excited and make things  **********

ddl

  • Sr. Member
  • ****
  • Posts: 118
  • Karma: 0
    • View Profile
Re: Voxcommando and Denise (Guile3d) Help
« Reply #10 on: January 14, 2016, 02:49:05 PM »
No, I have not tried this group.  I followed the steps outlined in the "VcToGuile3dAPI_final" PDF.  I will try this group tonight as well as a different browser. 

ddl

  • Sr. Member
  • ****
  • Posts: 118
  • Karma: 0
    • View Profile
Re: Voxcommando and Denise (Guile3d) Help
« Reply #11 on: January 15, 2016, 11:47:22 AM »
Ok, I was able to successfully connect Denise to VC.  Turns out that a reinstall of the Denise software with administrator privileges and disabling my windows firewall did the trick... I guess.  All I know now is that I am able to see the keys when making an http request for them.

Now that I was able to complete the first step.  I am now working on the second step which is to send data to the bot so that Denise can speak the text aloud.  I will report back if I get confused.

ddl

  • Sr. Member
  • ****
  • Posts: 118
  • Karma: 0
    • View Profile
Re: Voxcommando and Denise (Guile3d) Help
« Reply #12 on: January 15, 2016, 12:45:54 PM »
Ok, here is the second problem... When I start up Denise (standalone) I hear her voice and am able to make commands perfectly.  When I start up VC (standalone w/o Denise). I hear VC and am able to make commands via the mic perfectly.

However, when I I startup Denise and then VC I get no sound from either.  Any thoughts on why this could be happening?

nime5ter

  • Administrator
  • Hero Member
  • *****
  • Posts: 2012
  • Karma: 61
    • View Profile
    • Getting Started with VoxCommando
Re: Voxcommando and Denise (Guile3d) Help
« Reply #13 on: January 15, 2016, 03:04:28 PM »
Does it matter which program you open first, or does the audio problem happen either way?

By "hear VC," are you referring to TTS responses in VC, or something else?

Are both applications using a single, shared audio output?

If they're both trying to access the same audio output device, check your audio output Advanced properties. Maybe you have exclusive mode properties enabled or something like that.

If you have more than one audio output option, try to set VC to use a different audio output than whatever Guile is using. The default TTS audio output in VC can be selected in the TTS plugin settings.
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)

Kalle

  • $upporter
  • Hero Member
  • *****
  • Posts: 2319
  • Karma: 47
    • View Profile
Re: Voxcommando and Denise (Guile3d) Help
« Reply #14 on: January 15, 2016, 03:24:45 PM »
Quote
I am now working on the second step which is to send data to the bot so that Denise can speak the text aloud.


If you use my command group, don't forget to change the IP in the actions. If you need some other examples, let me know.
***********  get excited and make things  **********

ddl

  • Sr. Member
  • ****
  • Posts: 118
  • Karma: 0
    • View Profile
Re: Voxcommando and Denise (Guile3d) Help
« Reply #15 on: January 15, 2016, 03:42:23 PM »
@Kalle... Do I need to change the IP Address if both products are running on the same machine?

@Nime5ter...Yes, I am referring to TTS Responses and it doesn't matter which program is opened first.  I will check the other items you suggested shortly and report back.


ddl

  • Sr. Member
  • ****
  • Posts: 118
  • Karma: 0
    • View Profile
Re: Voxcommando and Denise (Guile3d) Help
« Reply #16 on: January 15, 2016, 03:56:16 PM »
Kalle.. Examples may help. Thanks

Kalle

  • $upporter
  • Hero Member
  • *****
  • Posts: 2319
  • Karma: 47
    • View Profile
Re: Voxcommando and Denise (Guile3d) Help
« Reply #17 on: January 15, 2016, 03:58:22 PM »
Normally the 127.0.0.1 is the local computer and you've right there is nothing to change.  ::)
***********  get excited and make things  **********

ddl

  • Sr. Member
  • ****
  • Posts: 118
  • Karma: 0
    • View Profile
Re: Voxcommando and Denise (Guile3d) Help
« Reply #18 on: January 15, 2016, 04:49:47 PM »
Just completed a test...  Here is whats happening.  When the computer is started Denise is started and works as expected.  Audio to and from Denise works.  When VC is started it kills the audio to and from Denise.  However, the audio from VC continues to work as expected.  I have disabled exclusive control of the audio devices as suggested in the computers Advanced audio properties.  Additionally, I have toggle between the audio outputs for TTS and still the same results.  No audio from Denise.

I am totally lost at this point. 

Kalle

  • $upporter
  • Hero Member
  • *****
  • Posts: 2319
  • Karma: 47
    • View Profile
Re: Voxcommando and Denise (Guile3d) Help
« Reply #19 on: January 15, 2016, 06:09:17 PM »
I will take a look tomorrow at my setup  ;)
Stay tuned
***********  get excited and make things  **********

ddl

  • Sr. Member
  • ****
  • Posts: 118
  • Karma: 0
    • View Profile
Re: Voxcommando and Denise (Guile3d) Help
« Reply #20 on: January 15, 2016, 09:15:34 PM »
Ok, Thanks...

Kalle

  • $upporter
  • Hero Member
  • *****
  • Posts: 2319
  • Karma: 47
    • View Profile
Re: Voxcommando and Denise (Guile3d) Help
« Reply #21 on: January 16, 2016, 06:25:46 AM »
Ok, I did take a look in my settings of Denise and VC and there is nothing special.


Did you use the TTS for Denise and VC at the same time? If your command for Denise has also a TTS.Speak or TTS.SpeakSync action - this will not work!  :o


You can use only the scrape action to get Denise speak text aloud.
« Last Edit: January 16, 2016, 06:34:35 AM by Kalle »
***********  get excited and make things  **********

ddl

  • Sr. Member
  • ****
  • Posts: 118
  • Karma: 0
    • View Profile
Re: Voxcommando and Denise (Guile3d) Help
« Reply #22 on: January 16, 2016, 09:18:15 AM »
No, I did not.  I have done a fresh install off VC and the only commands that I have are those that was provided in the xml to connect to Denise. 

jitterjames

  • Administrator
  • Hero Member
  • *****
  • Posts: 7714
  • Karma: 116
    • View Profile
    • VoxCommando
Re: Voxcommando and Denise (Guile3d) Help
« Reply #23 on: January 16, 2016, 09:42:26 AM »
It's not clear if the problem you are having is that Guile is preventing your AUDIO in VC from working or if it is preventing your TTS from working.  It's two different things with two different causes and possible resolutions.

For example, Kodi has default audio settings that will prevent any other program from using the audio output that Kodi is using.  Guile may be doing something similar.

On the other hand if the problem is only that TTS is not working in VC after you start using Guile then that is probably because you are trying to use the same voice in both programs and certain voices do not allow this.

ddl

  • Sr. Member
  • ****
  • Posts: 118
  • Karma: 0
    • View Profile
Re: Voxcommando and Denise (Guile3d) Help
« Reply #24 on: January 16, 2016, 10:19:05 AM »
Whew! Whooo!!!  It was the third scenario.  Changed the voices and it works!!!  Thanks for all your help.   

ddl

  • Sr. Member
  • ****
  • Posts: 118
  • Karma: 0
    • View Profile
Re: Voxcommando and Denise (Guile3d) Help
« Reply #25 on: January 16, 2016, 11:50:20 AM »
Now that I have Denise up and running.  Its time to modify my commands to accommodate her.  The first one that I have is a greeting command.
Code: [Select]
<?xml version="1.0" encoding="utf-16"?>
<!--VoxCommando 2.2.0.9-->
<command id="367" name="Greet computer" enabled="true" alwaysOn="False" confirm="False" requiredConfidence="0" loop="False" loopDelay="0" loopMax="0" description="">
  <if ifBlockDisabled="False" ifNot="False">
    <ifType>ProcessRunning</ifType>
    <ifParams>Kodi&amp;&amp;</ifParams>
    <then>
      <action>
        <cmdType>XJson.SoftMute</cmdType>
        <params>
          <param>20</param>
        </params>
        <cmdRepeat>1</cmdRepeat>
      </action>
    </then>
    <else />
  </if>
  <if ifBlockDisabled="False" ifNot="False">
    <ifType>ProcessRunning</ifType>
    <ifParams>ehshell&amp;&amp;</ifParams>
    <then>
      <action>
        <cmdType>WMC</cmdType>
        <params>
          <param>Mute</param>
        </params>
        <cmdRepeat>1</cmdRepeat>
      </action>
    </then>
    <else />
  </if>
  <if ifBlockDisabled="False" ifNot="False">
    <ifType>(A)Contains(B)</ifType>
    <ifParams>{1}&amp;&amp;morning</ifParams>
    <then>
      <action>
        <cmdType>TTSMS.SpeakSync</cmdType>
        <params>
          <param>Good morning.  who am I speaking to?</param>
        </params>
        <cmdRepeat>1</cmdRepeat>
      </action>
    </then>
    <else />
  </if>
  <if ifBlockDisabled="False" ifNot="False">
    <ifType>(A)Contains(B)</ifType>
    <ifParams>{1}&amp;&amp;afternoon</ifParams>
    <then>
      <action>
        <cmdType>TTSMS.SpeakSync</cmdType>
        <params>
          <param>Good afternoon. who am I speaking to?</param>
        </params>
        <cmdRepeat>1</cmdRepeat>
      </action>
    </then>
    <else />
  </if>
  <if ifBlockDisabled="False" ifNot="False">
    <ifType>(A)Contains(B)</ifType>
    <ifParams>{1}&amp;&amp;evening</ifParams>
    <then>
      <action>
        <cmdType>TTSMS.SpeakSync</cmdType>
        <params>
          <param>Good evening. who am I speaking to?</param>
        </params>
        <cmdRepeat>1</cmdRepeat>
      </action>
    </then>
    <else />
  </if>
  <if ifBlockDisabled="False" ifNot="False">
    <ifType>(A)Contains(B)</ifType>
    <ifParams>{1}&amp;&amp;hi</ifParams>
    <then>
      <action>
        <cmdType>TTSMS.SPeakSync</cmdType>
        <params>
          <param>Hello donald! how may i help you?| Hello donald! whats up| Yes, Donald| Donald, whats up!| Hey Donald, whats up!</param>
        </params>
        <cmdRepeat>1</cmdRepeat>
      </action>
    </then>
    <else>
      <action>
        <cmdType />
        <params />
        <cmdRepeat>1</cmdRepeat>
      </action>
    </else>
  </if>
  <if ifBlockDisabled="False" ifNot="False">
    <ifType>ProcessRunning</ifType>
    <ifParams>Kodi&amp;&amp;</ifParams>
    <then>
      <action>
        <cmdType>XJson.SoftUnMute</cmdType>
        <params />
        <cmdRepeat>1</cmdRepeat>
      </action>
    </then>
    <else />
  </if>
  <if ifBlockDisabled="False" ifNot="False">
    <ifType>ProcessRunning</ifType>
    <ifParams>ehshell&amp;&amp;</ifParams>
    <then>
      <action>
        <cmdType>WMC</cmdType>
        <params>
          <param>Volume Unmute</param>
        </params>
        <cmdRepeat>1</cmdRepeat>
      </action>
    </then>
    <else />
  </if>
  <action>
    <cmdType>VC.EnableGroup</cmdType>
    <params>
      <param>Program one</param>
    </params>
    <cmdRepeat>1</cmdRepeat>
  </action>
  <payloadList optional="true">good morning, good afternoon, good evening, hi, hey, whats up</payloadList>
  <phrase>kathy</phrase>
</command>

I realize that in order to have Denise speak I would need to use the scrape action.  For me, its easy enough to do for the commands that have one statement to speak.  Where i get confused is when I have multiple options that are chosen randomly for Denise to speak. For example:  Using the TTS method I would use
Code: [Select]
<action>
        <cmdType>TTSMS.SPeakSync</cmdType>
        <params>
          <param>Hello donald! how may i help you?| Hello donald! whats up| Yes, Donald| Donald, whats up!| Hey Donald, whats up!</param>
        </params>
        <cmdRepeat>1</cmdRepeat>
      </action>

How do I adjust this for Denise to speak using the Scrape action?

nime5ter

  • Administrator
  • Hero Member
  • *****
  • Posts: 2012
  • Karma: 61
    • View Profile
    • Getting Started with VoxCommando
Re: Voxcommando and Denise (Guile3d) Help
« Reply #26 on: January 16, 2016, 12:13:49 PM »
You won't be able to use VC's pipe | syntax in the Scrape action since I doubt Guile 3D uses that syntax.

You'll have to experiment with passing a random variable of some kind -- whether you change your current TTS lines to Result.SetLastResult actions and then add a regular expressions to evaluate that string and pass a {Match.Rnd} to your Scrape action, or put all your possible responses in a payload XML file and use the appropriate action to get a random phrase, or somehow use VC's  random number generator variable to randomly select a payload or read a random line number from a file that has all the possible responses, etc. Choose your poison. VC provides a variety of different methods for retrieving random results/values.

... Or you could consult the Guile 3D documentation or forum to see if they do have syntax for generating random responses. But that may be difficult to do using a URL string.
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)

ddl

  • Sr. Member
  • ****
  • Posts: 118
  • Karma: 0
    • View Profile
Re: Voxcommando and Denise (Guile3d) Help
« Reply #27 on: January 16, 2016, 12:26:46 PM »
Ok, figured that as much.  I have no experience with using the action "Result.SetLastResult" in VC so I think at this point I will stay away from using it.  I have very little experience using payloads but am willing to try and figure it out. 

ddl

  • Sr. Member
  • ****
  • Posts: 118
  • Karma: 0
    • View Profile
Re: Voxcommando and Denise (Guile3d) Help
« Reply #28 on: January 16, 2016, 12:31:34 PM »
Also,  I looked at the talking head option provided by VC.  If I went this route going forward.  Can I create my own avatar with the movements such as Denise?  Trying to keep my setup as clean as possible to avoid a nightmare with troubleshooting if necessary.

Kalle

  • $upporter
  • Hero Member
  • *****
  • Posts: 2319
  • Karma: 47
    • View Profile
Re: Voxcommando and Denise (Guile3d) Help
« Reply #29 on: January 16, 2016, 01:44:21 PM »
You can create your own Avatar, but this will not looks like Denise. Try also first a search in the Forum before you ask for help, because this question is already answered  ;)

http://voxcommando.com/forum/index.php?topic=1619.msg14154#msg14154
« Last Edit: January 16, 2016, 03:39:48 PM by Kalle »
***********  get excited and make things  **********

ddl

  • Sr. Member
  • ****
  • Posts: 118
  • Karma: 0
    • View Profile
Re: Voxcommando and Denise (Guile3d) Help
« Reply #30 on: January 16, 2016, 04:46:23 PM »
gotcha...

last question for the day :)  I have created a command to greet Denise.  The command has three terms that I can use to address Denise that will generate three different responses from Denise.
Code: [Select]
<?xml version="1.0" encoding="utf-16"?>
<!--VoxCommando 2.2.0.9-->
<command id="359" name=" Greet Computer New" enabled="true" alwaysOn="False" confirm="False" requiredConfidence="0" loop="False" loopDelay="0" loopMax="0" description="">
  <if ifBlockDisabled="False" ifNot="False">
    <ifType>(A)Contains(B)</ifType>
    <ifParams>{1}&amp;&amp;hi</ifParams>
    <then>
      <action>
        <cmdType>scrape</cmdType>
        <params>
          <param>http://127.0.0.1:8000/Agent?function=AgentSpeak&amp;Auth={M:botpass.botpass}&amp;Text=Hi  Donald, what can I do for you.</param>
        </params>
        <cmdRepeat>1</cmdRepeat>
      </action>
    </then>
    <else />
  </if>
  <if ifBlockDisabled="False" ifNot="False">
    <ifType>(A)Contains(B)</ifType>
    <ifParams>{1}&amp;&amp;hey</ifParams>
    <then>
      <action>
        <cmdType>scrape</cmdType>
        <params>
          <param>http://127.0.0.1:8000/Agent?function=AgentSpeak&amp;Auth={M:botpass.botpass}&amp;Text=Hey Donald, Whats up.</param>
        </params>
        <cmdRepeat>1</cmdRepeat>
      </action>
    </then>
    <else />
  </if>
  <if ifBlockDisabled="False" ifNot="False">
    <ifType>(A)Contains(B)</ifType>
    <ifParams>{1}&amp;&amp;whats up</ifParams>
    <then>
      <action>
        <cmdType>scrape</cmdType>
        <params>
          <param>http://127.0.0.1:8000/Agent?function=AgentSpeak&amp;Auth={M:botpass.botpass}&amp;Text=Nothing much, how can I help you.</param>
        </params>
        <cmdRepeat>1</cmdRepeat>
      </action>
    </then>
    <else />
  </if>
  <payloadList>hi,hey,whats up</payloadList>
  <phrase>kathy</phrase>
</command>

I would like to expand on the list of responses but I am having trouble figuring out how the payload list via xml works.  At the end of the day I would like to shorten my command so that I can have more responses from Denise that are chosen at random.  Can you help me by pointing me in the right direction?  Meanwhile, will read up a little more on how generate building and implementing payloads.

Kalle

  • $upporter
  • Hero Member
  • *****
  • Posts: 2319
  • Karma: 47
    • View Profile
Re: Voxcommando and Denise (Guile3d) Help
« Reply #31 on: January 16, 2016, 05:13:08 PM »
Hi ddl, you can try following:

1. delete all actions and  IF blocks in your command
2. insert instead

scrape:  http://127.0.0.1:8000/Agent?function=AgentSpeak&amp;Auth={M:botpass.botpass}&amp;Text=Hi  Donald, what can I do for you.| Hey Donald, Whats up. | Nothing much, how can I help you. | I hope my answers will not be repeated

The "vertical bar" let the text read aloud randomly from Denise (not tested, but you can try it)  ;)
« Last Edit: January 16, 2016, 05:21:55 PM by Kalle »
***********  get excited and make things  **********

ddl

  • Sr. Member
  • ****
  • Posts: 118
  • Karma: 0
    • View Profile
Re: Voxcommando and Denise (Guile3d) Help
« Reply #32 on: January 16, 2016, 05:35:18 PM »
tried your example.  The answers were repeated. 

Kalle

  • $upporter
  • Hero Member
  • *****
  • Posts: 2319
  • Karma: 47
    • View Profile
Re: Voxcommando and Denise (Guile3d) Help
« Reply #33 on: January 16, 2016, 06:10:49 PM »
 :bonk Yes this can't work - I will show you a solution tomorrow  ;)
***********  get excited and make things  **********

nime5ter

  • Administrator
  • Hero Member
  • *****
  • Posts: 2012
  • Karma: 61
    • View Profile
    • Getting Started with VoxCommando
Re: Voxcommando and Denise (Guile3d) Help
« Reply #34 on: January 16, 2016, 06:15:57 PM »
Attached to this post are 2 files. One is a payload XML file (contact list.xml). The other is a simple text file (Einstein_quotes.txt).

Please download them.

- Put the payload XML file in the "payloads" subfolder within your VoxCommando folder.
- Put the text file directly in the VoxCommando folder.
- Copy the entire command group below into your command tree. Save and exit your tree.
- It's also a good idea to enable the History window (check the "history" box in the main UI).
- Then go back in to the command tree ("Edit") so you can start to explore these commands.


The commands are numbered. Start with the first one.

Look at the command phrasing in the tree. Then double-click to open up the command and look at the macro there.

Issue the voice command, see what happens.

Once you feel you understand that command, move on to the next command. Et cetera.

When you get to Command 4, which introduces payload XML files, start by double-clicking on the payload XML file in your command tree.

Choose "Open/Edit" so that you can view what's in that file. Take note of the phrases. If you want, you can add some of your own and save the changes.

Then go look at the command's macro so that you can see how the payload file is being used.

Issue the voice command a few times (now that you know the phrases that are in the payload xml file).

Make sense? Good. Move on to the next command.

If you spend half an hour going through these commands one by one sequentially, at the end you will have learned fundamentals that you can apply to other situations.

And you will also have learned several different ways to handle your current random TTS response problem.

Code: [Select]
<?xml version="1.0" encoding="utf-16"?>
<!--VoxCommando 2.2.1.4-->
<commandGroup open="True" name="VoxCommando basics" enabled="True" prefix="" priority="0" requiredProcess="" description="">
  <command id="177" name="1. Set last result" enabled="true" alwaysOn="False" confirm="False" requiredConfidence="0" loop="False" loopDelay="0" loopMax="0" description="The action description says exactly what Results.SetLastResult does. If this command does not make sense, roll over the action field or click the &quot;magic wand&quot; to see the action description. If you don't understand what the {LastResult} variable in VC is, see the variables page of the wiki.">
    <action>
      <cmdType>Results.SetLastResult</cmdType>
      <params>
        <param>I'm now setting the content of the 'last result' variable in VC.</param>
      </params>
      <cmdRepeat>1</cmdRepeat>
    </action>
    <action>
      <cmdType>OSD.ShowText</cmdType>
      <params>
        <param>{LastResult}</param>
      </params>
      <cmdRepeat>1</cmdRepeat>
    </action>
    <phrase>Set last result</phrase>
  </command>
  <command id="178" name="2. Learn how to use one payload" enabled="true" alwaysOn="False" confirm="False" requiredConfidence="0" loop="False" loopDelay="0" loopMax="0" description="This voice command includes a PAYLOAD LIST of people's names. When we say the voice command, &quot;Say hello to X&quot;, X is the PAYLOAD. In other words, we are giving the command ONE PAYLOAD that can be used in the command. That is the {1}.">
    <action>
      <cmdType>OSD.ShowText</cmdType>
      <params>
        <param>Hello {1}</param>
      </params>
      <cmdRepeat>1</cmdRepeat>
    </action>
    <action>
      <cmdType>TTS.Speak</cmdType>
      <params>
        <param>Hello {1}</param>
      </params>
      <cmdRepeat>1</cmdRepeat>
    </action>
    <phrase>Say hello to</phrase>
    <payloadList>John, Bob, Dan, Maggie, Linda</payloadList>
  </command>
  <command id="179" name="3. Learn how to use two payloads" enabled="true" alwaysOn="False" confirm="False" requiredConfidence="0" loop="False" loopDelay="0" loopMax="0" description="This voice command uses TWO PAYLOADS. &#xD;&#xA;1. A PAYLOAD RANGE of numbers ranging from 2 to 20. &#xD;&#xA;2. A PAYLOAD LIST of words.&#xD;&#xA;So the {1} will be replaced with the number we say, and the {2} will be replaced by the word we choose.">
    <action>
      <cmdType>OSD.ShowText</cmdType>
      <params>
        <param>You asked me to show you: {1} {2}</param>
      </params>
      <cmdRepeat>1</cmdRepeat>
    </action>
    <action>
      <cmdType>TTS.Speak</cmdType>
      <params>
        <param>You asked me to show you: {1} {2}</param>
      </params>
      <cmdRepeat>1</cmdRepeat>
    </action>
    <phrase>Show me</phrase>
    <payloadRange>2,10</payloadRange>
    <payloadList>apples, bananas, spoons, forks</payloadList>
  </command>
  <command id="180" name="4. Learn how a payload XML file works" enabled="true" alwaysOn="False" confirm="False" requiredConfidence="0" loop="False" loopDelay="0" loopMax="0" description="This command uses just ONE PAYLOAD. The payload will come from a list of payload VALUES stored in a PAYLOAD XML file.&#xD;&#xA;&#xD;&#xA;A payload XML file is just a reference table with two columns. Usually we use a &quot;value/phrase&quot; payload XML file, where a friendly phrase is associated with a value that the command will need. That way, in our voice command, we can say the friendly phrase, and VC will understand that it should retrieve the associated value. In this case, the friendly phrase is our contact's name. The value is that contact's phone number.&#xD;&#xA;If the payload XML is the only payload we're using in our command, then:&#xD;&#xA;The value stored in the table is accessed using {1}.&#xD;&#xA;Sometimes we may also need to get the phrase, not just the value. The phrase is known as the &quot;friendly payload&quot;. We can access it using the syntax: {PF.1}">
    <action>
      <cmdType>OSD.ShowText</cmdType>
      <params>
        <param>Sure. The phone number is: {1}</param>
      </params>
      <cmdRepeat>1</cmdRepeat>
    </action>
    <phrase>Do you have the phone number for</phrase>
    <payloadFromXML phraseOnly="False" use2partPhrase="False" phraseConnector="by" Phrase2wildcard="anyone" optional="False">payloads\contact list.xml</payloadFromXML>
  </command>
  <command id="131" name="5. Using payload XML in the macro, but not the voice command" enabled="true" alwaysOn="False" confirm="False" requiredConfidence="0" loop="False" loopDelay="0" loopMax="0" description="Usually we want to access payload XML values by asking for something specific in our voice command. But that's not the only way we can use them. These files are convenient ways to store information. And then we can retrieve that information at any time by &quot;reading&quot; the file within our macros. The action &quot;PayloadXML.GetRandomP&quot; is one of several actions that allow us to access data stored in a payloadXML file.">
    <action>
      <cmdType>PayloadXML.GetRandomP</cmdType>
      <params>
        <param>payloads\contact list.xml</param>
      </params>
      <cmdRepeat>1</cmdRepeat>
    </action>
    <action>
      <cmdType>OSD.ShowText</cmdType>
      <params>
        <param>Here is a random phrase: {Match.1}</param>
        <param>5000</param>
      </params>
      <cmdRepeat>1</cmdRepeat>
    </action>
    <phrase>Read me a random phrase from a payload XML file</phrase>
  </command>
  <command id="132" name="6. Another way to read text from a file" enabled="true" alwaysOn="False" confirm="False" requiredConfidence="0" loop="False" loopDelay="0" loopMax="0" description="We can also read text from normal text files, not just payload XML files. Look up the action description for File.Read for more information.">
    <action>
      <cmdType>File.Read</cmdType>
      <params>
        <param>Einstein_quotes.txt</param>
        <param>{1}</param>
      </params>
      <cmdRepeat>1</cmdRepeat>
    </action>
    <action>
      <cmdType>OSD.ShowText</cmdType>
      <params>
        <param>Line {1} says: {LastResult}</param>
      </params>
      <cmdRepeat>1</cmdRepeat>
    </action>
    <action>
      <cmdType>TTS.SpeakSync</cmdType>
      <params>
        <param>{LastResult}</param>
      </params>
      <cmdRepeat>1</cmdRepeat>
    </action>
    <phrase>Read me line number</phrase>
    <payloadRange>1,8</payloadRange>
  </command>
  <command id="188" name="7. Other interesting things you can do with text files" enabled="true" alwaysOn="False" confirm="False" requiredConfidence="0" loop="False" loopDelay="0" loopMax="0" description="Here, instead of telling VC what line to read from the file, we use the random number generator to randomly select a line of text from the file. Again, see the variables page of the wiki for a description of the variable {Rnd.#.#}.">
    <action>
      <cmdType>File.Read</cmdType>
      <params>
        <param>Einstein_quotes.txt</param>
        <param>{Rnd.0.8}</param>
      </params>
      <cmdRepeat>1</cmdRepeat>
    </action>
    <action>
      <cmdType>OSD.ShowText</cmdType>
      <params>
        <param>Here's a random line: {LastResult}</param>
      </params>
      <cmdRepeat>1</cmdRepeat>
    </action>
    <action>
      <cmdType>TTS.Speak</cmdType>
      <params>
        <param>{LastResult}</param>
      </params>
      <cmdRepeat>1</cmdRepeat>
    </action>
    <phrase>Read me random line from my text file</phrase>
  </command>
  <command id="1491" name="8. Playing with a LastResult" enabled="true" alwaysOn="False" confirm="False" requiredConfidence="0" loop="False" loopDelay="0" loopMax="0" description="We mostly perform regular expressions on {LastResult}. Here, we capture each phrase that's contained within &quot;quotation marks&quot;. Each of them is stored as: {Match.1}, {Match.2}, etc.">
    <action>
      <cmdType>Results.SetLastResult</cmdType>
      <params>
        <param>"Hey there."  "Aloha, what's up" "What do you want?" "Cheers, mate" "What's the story, morning glory?"</param>
      </params>
      <cmdRepeat>1</cmdRepeat>
    </action>
    <action>
      <cmdType>Results.RegEx</cmdType>
      <params>
        <param>"(.*?)"</param>
      </params>
      <cmdRepeat>1</cmdRepeat>
    </action>
    <action>
      <cmdType>OSD.ShowText</cmdType>
      <params>
        <param>Random response: {Match.Rnd}</param>
      </params>
      <cmdRepeat>1</cmdRepeat>
    </action>
    <phrase>Surprise me</phrase>
  </command>
</commandGroup>

« Last Edit: January 20, 2016, 11:13:13 AM by nime5ter »
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)

Kalle

  • $upporter
  • Hero Member
  • *****
  • Posts: 2319
  • Karma: 47
    • View Profile
Re: Voxcommando and Denise (Guile3d) Help
« Reply #35 on: January 17, 2016, 01:41:57 AM »
Best tutorial which I ever seen in the VC-Forum. I think this will help all users a lot  ::bow :clap


Thanks Nime5ter
***********  get excited and make things  **********

nime5ter

  • Administrator
  • Hero Member
  • *****
  • Posts: 2012
  • Karma: 61
    • View Profile
    • Getting Started with VoxCommando
Re: Voxcommando and Denise (Guile3d) Help
« Reply #36 on: January 17, 2016, 07:30:21 AM »
nime5ter great tutorial,   :clap

I took a look at the commands and I noticed that in the command "5. Using payload XML in the macro, but not the voice command" you forget to change the file path

it reminded me that I wanted to make a feature request for a program variable for "Username" but forgot after I set it up using python

Oops! Thanks for catching that. Fixed now. (I also reduced my line number ranges in the File.Read commands, since my Einstein quote file doesn't have that many quotes in it. Ha. That's what happens when you're multitasking and trying to do things quickly without proper bug testing.)

Cool to see you using Python stuff now, in VC. Looks like you found a neat Python module. I'm going to split your post off into a separate feature request post, just to keep this topic a bit more on course.
« Last Edit: January 17, 2016, 07:53:57 AM by nime5ter »
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)

nime5ter

  • Administrator
  • Hero Member
  • *****
  • Posts: 2012
  • Karma: 61
    • View Profile
    • Getting Started with VoxCommando
Re: Voxcommando and Denise (Guile3d) Help
« Reply #37 on: January 17, 2016, 07:43:29 AM »
Best tutorial which I ever seen in the VC-Forum. I think this will help all users a lot  ::bow :clap


Thanks Nime5ter

Thanks, Kalle. I hope it will be of use. If there's evidence that it is, I'll put it somewhere easy to find, and maybe build off the idea with a video tutorial or something.
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)

ddl

  • Sr. Member
  • ****
  • Posts: 118
  • Karma: 0
    • View Profile
Re: Voxcommando and Denise (Guile3d) Help
« Reply #38 on: January 17, 2016, 11:33:28 AM »
Thank you for the tutorial.  Working to understand it all.  Here is a command that I have created as a result of one examples that you have listed.

Code: [Select]
<?xml version="1.0" encoding="utf-16"?>
<!--VoxCommando 2.2.0.9-->
<command id="372" name=" Greet Computer New" enabled="true" alwaysOn="False" confirm="False" requiredConfidence="0" loop="False" loopDelay="0" loopMax="0" description="">
  <action>
    <cmdType>PayloadXML.GetRandomP</cmdType>
    <params>
      <param>C:\Users\Donald\VC42615\payloads\Greeting Responses.xml</param>
    </params>
    <cmdRepeat>1</cmdRepeat>
  </action>
  <action>
    <cmdType>Scrape</cmdType>
    <params>
      <param>http://127.0.0.1:8000/Agent?function=AgentSpeak&amp;Auth={M:botpass.botpass}&amp;Text={Match.1}</param>
    </params>
    <cmdRepeat>1</cmdRepeat>
  </action>
  <action>
    <cmdType>OSD.ShowText</cmdType>
    <params>
      <param>{Match.1}</param>
    </params>
    <cmdRepeat>1</cmdRepeat>
  </action>
  <payloadList optional="true">hi,hey kathy,whats up</payloadList>
  <payloadFromXML phraseOnly="True" use2partPhrase="False" phraseConnector="by" Phrase2wildcard="anyone" optional="False">payloads\Greeting Responses.xml</payloadFromXML>
  <phrase>Kathy</phrase>
</command>

Not sure if my code is written correctly or not but I only get a response when I use the "Whats up" phrase.  I get nothing when using the other two.  What am I doing wrong?

Kalle

  • $upporter
  • Hero Member
  • *****
  • Posts: 2319
  • Karma: 47
    • View Profile
Re: Voxcommando and Denise (Guile3d) Help
« Reply #39 on: January 17, 2016, 11:57:15 AM »
Get sure that you have not - kathy, hey or similar in use as prefix in VC options, but only guess - you did not said what is not working or what the history window shows.
***********  get excited and make things  **********

ddl

  • Sr. Member
  • ****
  • Posts: 118
  • Karma: 0
    • View Profile
Re: Voxcommando and Denise (Guile3d) Help
« Reply #40 on: January 17, 2016, 12:09:37 PM »
Yes, I'm sure that Kathy is not used as a prefix in VC options.  What happens is that when I speak the command (hi kathy or hey kathy) it shows VC not recognized in the history.  However, when speak the command "whats up kathy" it works.

jitterjames

  • Administrator
  • Hero Member
  • *****
  • Posts: 7714
  • Karma: 116
    • View Profile
    • VoxCommando
Re: Voxcommando and Denise (Guile3d) Help
« Reply #41 on: January 17, 2016, 06:44:09 PM »
OK, as the big cheese I took the liberty of removing some unproductive posts.

Not sure if my code is written correctly or not but I only get a response when I use the "Whats up" phrase.  I get nothing when using the other two.  What am I doing wrong?

Your command makes no sense.  So that is why it doesn't work.  You need to learn the basics of constructing a voice command.  I hope you can find the resources you need.  They are certainly available to you if you are interested.

JonPeyton

  • $upporter
  • Jr. Member
  • *****
  • Posts: 36
  • Karma: 3
    • View Profile
Re: Voxcommando and Denise (Guile3d) Help
« Reply #42 on: April 12, 2016, 09:02:36 PM »
Thank you for this,very imaginative and quite useful!