Author Topic: confirm within the command builder?  (Read 2484 times)

0 Members and 1 Guest are viewing this topic.

Beaupa

  • Jr. Member
  • **
  • Posts: 15
  • Karma: 0
    • View Profile
confirm within the command builder?
« on: February 05, 2014, 02:46:11 PM »
Hey guys, very new vox user here that is trying to learn the ropes. I cannot afford any new TTS voices atm so I have come up with a workaround by making my own via mp3. I would like vox to do the following:

open file> confirm> [if yes] do something [if no] do something else

It seems simple enough, but I have been searching and watching videos and I only see confirm>execute

Im pretty sure im just missing a command here or syntax. I even tried storing a "choice.confirm" event as a payload and that didnt seem to work. Its been two days now so I thought I would post. Any help is appreciated.

-mike

nime5ter

  • Administrator
  • Hero Member
  • *****
  • Posts: 1999
  • Karma: 61
    • View Profile
    • Getting Started with VoxCommando
Re: confirm within the command builder?
« Reply #1 on: February 05, 2014, 03:41:19 PM »
Hi Beaupa, and welcome. Sounds like you've been very creative. We like that.   ;D

It's not super clear what you're trying to do, but if I'm understanding you correctly then:

The command confirmation feature generates two possible events, and you can use this. Create two commands.

Command 1: "Open file" -- opens a file if you confirm that you want it to do this.

If you say "no" instead, then an event will be generated of the form "Confirm.Cancel.[commandname]" (you'll see this in the history panel).

You can use this event to trigger Command 2 instead. See below (you can copy and paste this directly into your command tree to play with it).
Code: [Select]
<?xml version="1.0" encoding="utf-16"?>
<commandGroup open="True" name="do this or that" enabled="True" prefix="" priority="0" requiredProcess="" description="">
  <command id="635" name="open file" enabled="true" alwaysOn="False" confirm="True" requiredConfidence="0" loop="False" loopDelay="0" loopMax="0" description="">
    <action>
      <cmdType>Launch.OpenFile</cmdType>
      <cmdString>filepath\file.mp3</cmdString>
      <cmdRepeat>1</cmdRepeat>
    </action>
    <phrase>open file</phrase>
  </command>
  <command id="638" name="no, do this instead" enabled="true" alwaysOn="False" confirm="False" requiredConfidence="0" loop="False" loopDelay="0" loopMax="0" description="">
    <action>
      <cmdType>OSD.ShowText</cmdType>
      <cmdString>I'm doing this instead!</cmdString>
      <cmdRepeat>1</cmdRepeat>
    </action>
    <event>Confirm.Cancel.open file</event>
  </command>
</commandGroup>
« Last Edit: February 05, 2014, 04:45:35 PM 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: 1999
  • Karma: 61
    • View Profile
    • Getting Started with VoxCommando
Re: confirm within the command builder?
« Reply #2 on: February 05, 2014, 04:43:54 PM »
Update: sorry, I just edited my code above because I accidentally broke the xml before pasting it to the forum (I changed the name of command 1, so the command name did not match the event name).

If you've already tried it without luck, that is why. The xml that's there now should work.
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)

Beaupa

  • Jr. Member
  • **
  • Posts: 15
  • Karma: 0
    • View Profile
Re: confirm within the command builder?
« Reply #3 on: February 05, 2014, 05:40:56 PM »
Thanks for the reply nime5ter. I tried looking at it your way and it still wont work. I may have not explained proper so I'll do a full example. Keep in mind this is just what I want to happen and not my actual events because im doing something wrong... haha

I say "play my tune"
vox says "OK sir, i will play your music, standby"  (this is a file in .mp3 format)
vox opens a browser to youtube and starts
vox says "is that all sir?" (file in mp3 format)

[its at this point I need the confirm yes/no]

if yes vox "OK, ill be here if you need me" (file mp3) > to standby
if no vox "No problem, what else?" (file mp3) > to on

This is the best example I can give. Now alot of people would probably say just buy the TTS voice, but its actually pretty quick to import the mp3s.

I tried your example but the (no/cancel) event would not trigger using Confirm.Cancel.Launch.OpenFile[path to my mp3]

Still plugging away but my head hurts lol
-mike

Beaupa

  • Jr. Member
  • **
  • Posts: 15
  • Karma: 0
    • View Profile
Re: confirm within the command builder?
« Reply #4 on: February 05, 2014, 05:47:22 PM »
mini update: your update seemed to work. ill keep ya posted... and THANK YOU :)

Yup, that worked like a charm. Could you please try to explain to me how the Confirm.Cancel event triggers on the Open File command? Is it just vox reading the Confirm.Cancel value in top down sequence? I cant see how the two are related, but it works LMAO

its been a long day
-mike

another edit: maybe they are just related because of the "do this or that" group?
« Last Edit: February 05, 2014, 06:20:52 PM by Beaupa »

Kalle

  • $upporter
  • Hero Member
  • *****
  • Posts: 2320
  • Karma: 47
    • View Profile
Re: confirm within the command builder?
« Reply #5 on: February 05, 2014, 05:59:53 PM »
This video will show you a "how to" create a command with confirmation step by step.

http://www.youtube.com/watch?v=_D17Zk1MMZQ
***********  get excited and make things  **********

Beaupa

  • Jr. Member
  • **
  • Posts: 15
  • Karma: 0
    • View Profile
Re: confirm within the command builder?
« Reply #6 on: February 05, 2014, 06:26:21 PM »
This video will show you a "how to" create a command with confirmation step by step.

http://www.youtube.com/watch?v=_D17Zk1MMZQ


Thank you Kalle, Ive seen that before. The only thing is that your video does not show how to branch the "no/cancel" command. I even spent a day experimenting with logic IF actions and that wasnt working for me. The above post does work. Just figuring how the event is tied to the command.

-mike

nime5ter

  • Administrator
  • Hero Member
  • *****
  • Posts: 1999
  • Karma: 61
    • View Profile
    • Getting Started with VoxCommando
Re: confirm within the command builder?
« Reply #7 on: February 05, 2014, 06:26:49 PM »
Yup, that worked like a charm. Could you please try to explain to me how the Confirm.Cancel event triggers on the Open File command? Is it just vox reading the Confirm.Cancel value in top down sequence? I cant see how the two are related, but it works LMAO

its been a long day
-mike

But a fun day, right? Ha.

It sounds like you are not understanding what events are and how they work. I would recommend watching the video tutorial on events:


What's happening with the xml I gave you is that when you tell your first command "No, I don't want you to run" an event is generated. You can see all the events that VC generates in your history window. They have little calendar icons. Every single time that you cancel that first command (which is set to require confirmation), VC will generate that event.

Any such event can be used instead of a voice command to trigger a command.

... Get back to us after you've watched the video and ruminated a while.

That said, based on your described scenario, I don't think you need to use command confirmation at all. You could have one command that says "OK I'm here if you need me" and then switches VC to standby mode. You use a voice command phrase like "Yes, that's all thanks" to trigger it. You have another command that just plays the "No problem, what else?" mp3 but does nothing (why would it need to change VC to on? Isn't VC already on if you just gave it a voice command?).

Your only "real" comand is the "Play my tune". That one launches your youtube url and also plays your "Is that all, sir?" mp3 file. Not sure if your computer will like trying to play a video on youtube and simultaneously play an mp3 in some other player though. Have you tried this?

Sounds like a lot of work just to avoid using Windows' lousy Anna TTS voice. :)
« Last Edit: February 05, 2014, 07:21:19 PM 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: 1999
  • Karma: 61
    • View Profile
    • Getting Started with VoxCommando
Re: confirm within the command builder?
« Reply #8 on: February 05, 2014, 06:28:01 PM »
wiki entry on events: http://voxcommando.com/mediawiki/index.php?title=Events

That entry needs some work though.
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: 1999
  • Karma: 61
    • View Profile
    • Getting Started with VoxCommando
Re: confirm within the command builder?
« Reply #9 on: February 05, 2014, 09:03:22 PM »
Just figuring how the event is tied to the command.

In this case, it just so happens that James has programmed VC to automatically generate two possible events for commands that require confirmation: (1) if you confirm that you want a command to be executed, an event is automatically generated, and (2) if you cancel a confirm-required command it generates a different event (as per above).

The xml I posted for you just takes advantage of that built-in VC feature.

Keep an eye on your history window, and you may see other automatically generated events that will come in handy. People commonly use the "VC.Loaded" event to trigger commands when VC first launches, for example.
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)

Beaupa

  • Jr. Member
  • **
  • Posts: 15
  • Karma: 0
    • View Profile
Re: confirm within the command builder?
« Reply #10 on: February 06, 2014, 10:39:57 AM »
Good Morning, that youtube video was very helpful. You were absolutely right. I had no idea that VC could trigger via events. Thats why I missed that, cause I dont want you guys thinking that I am not searching here.

Last night I found a webpage with a list of events (I do not mean the actions, the actual events) all I remember is the page had labeled it for more advanced VC users or something. Anyway, that page was helpful in understanding too. I lost the page, so if anyone knows the page I mean please relink it :)

back to work for me

btw, I think I am going to restart my xml and just use TTS, Once I have things tweaked I will invest in a better voice...lol

thanks guys
-mike
« Last Edit: February 06, 2014, 10:55:29 AM by Beaupa »

nime5ter

  • Administrator
  • Hero Member
  • *****
  • Posts: 1999
  • Karma: 61
    • View Profile
    • Getting Started with VoxCommando
Re: confirm within the command builder?
« Reply #11 on: February 06, 2014, 11:45:41 AM »
Hm. Sorry, apart from the wiki page on events that I linked to above, I don't know of any web page that lists all the possible events. There are lots. Keep an eye on your history panel, where they always appear.
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)