Author Topic: Make that voice commando ask a question  (Read 6901 times)

0 Members and 1 Guest are viewing this topic.

albertpujol

  • Jr. Member
  • **
  • Posts: 15
  • Karma: 0
    • View Profile
Make that voice commando ask a question
« on: April 05, 2013, 04:20:52 AM »
What I've in mind it's the next.

I've a automation script in evenghost that turn my system peripherical (Amplifier, Tv projector, ambient ligth etcetera ) automatically every nigth at 12 o'clock , just in case I forgot to turn it out, the computer evenghost does it   for me , but sometimes I'm stilll doing things with the computer so It's annoying I  would like that voxcommando behaves likes this :

I trigger an event with evenghost at 12 o'clock to voice commando , I want that vox commando says (in the screen and/or TTS) "Computer is gonna turn the system off in 60 seconds, say cancel (or another thing) to abort", if I don't say nothing after that 60 second I want to trigger a evenghost event (the one who closes the system) and if I say cancel just do nothing.

Is possible to implement this in some way?

jitterjames

  • Administrator
  • Hero Member
  • *****
  • Posts: 7714
  • Karma: 116
    • View Profile
    • VoxCommando
Re: Make that voice commando ask a question
« Reply #1 on: April 05, 2013, 02:09:28 PM »
Here are the broad strokes.

EventGhost > timer runs event at 12:00
     set variable eg.global.cancelsleep to false
        send event to VC using broadcaster which gives you the alert (TTS or whatever)

EventGhost > timer runs event at 12:05
    checks is variable eg.global.cancelsleep is true or false
    if it is false, then put computer to sleep

EventGhost > has a command to set variable eg.global.cancelsleep to true, this command is triggered by an Broadcaster.CancelSleep event which is sent by VoxCommando

VoxCommando >  has a command that will warn the user that computer will shut down, triggered by the event from EventGhost
VoxCommando >  has a voice command that when triggered, will send an event (CancelSleep) to EventGhost.

koopaking

  • Jr. Member
  • **
  • Posts: 6
  • Karma: 0
    • View Profile
Re: Make that voice commando ask a question
« Reply #2 on: May 16, 2013, 10:32:09 PM »
Hello,

Is it possible to have VC ask a question without eventghost? For example I have a command to open netflix, is it possible for VC to ask would you like to watch Top Gear (a tv show on netflix I regularly watch) and if I say yes obviously it will go to the netflix top gear url, otherwise it will just go to the regular home page url.

Thanks

Kalle

  • $upporter
  • Hero Member
  • *****
  • Posts: 2320
  • Karma: 47
    • View Profile
Re: Make that voice commando ask a question
« Reply #3 on: May 17, 2013, 03:34:14 AM »
Hello,

Is it possible to have VC ask a question without eventghost? For example I have a command to open netflix, is it possible for VC to ask would you like to watch Top Gear (a tv show on netflix I regularly watch) and if I say yes obviously it will go to the netflix top gear url, otherwise it will just go to the regular home page url.

Thanks
Yes it is possible  :)
But I think it is better that VC ask you "Which kind of video would you prefer?" and you can answer "show me Top Gear". The URL's for videos is stored in a payload and so you are more flexible in this way.
I'm not at home, but I can give you a command example in the evening.
***********  get excited and make things  **********

jitterjames

  • Administrator
  • Hero Member
  • *****
  • Posts: 7714
  • Karma: 116
    • View Profile
    • VoxCommando
Re: Make that voice commando ask a question
« Reply #4 on: May 17, 2013, 11:18:26 AM »
Is it possible to have VC ask a question without eventghost?
What do you mean by "without eventghost"?  How would you do it with eventGhost?

VC is really more designed for you to specify exactly what you want, and then have VC act appropriately.  It is not really designed for back and forth interaction, or menus etc.

That said, it is still possible to do what you want in a couple of different ways.  One way to do it is to enable a group that is normally off.  That group could contain the two commands.

Group named  "Open Netflix", normally OFF:
commands:
- "yes please", or "top gear"  >>>   opens the top gear page,  >>>    then disables the Netflix group
- "no thanks" or "just netflix"  >>>   opens the regular url,  >>>    then disables the Netflix group

A regular command:  
- "open netflix"  >>>   use TTS.Speak to say "would you like to watch Top Gear?"  >>>   enables the group "Open Netflix"

but as Kalle says, I think it would be easier to set up (and simple and faster for the user) if you just create commands

- "open netflix"
- "watch topgear on netflix" etc.

koopaking

  • Jr. Member
  • **
  • Posts: 6
  • Karma: 0
    • View Profile
Re: Make that voice commando ask a question
« Reply #5 on: May 17, 2013, 11:32:53 AM »
Sorry I only said without eventghost because the original question was dealing with eventghost.

Kalle an command example would be great.

Thanks

Kalle

  • $upporter
  • Hero Member
  • *****
  • Posts: 2320
  • Karma: 47
    • View Profile
Re: Make that voice commando ask a question
« Reply #6 on: May 17, 2013, 05:44:17 PM »
Sorry I only said without eventghost because the original question was dealing with eventghost.

Kalle an command example would be great.

Thanks
here we go  ;)
It is a very easy thing, you must only edit the "netflixURL.xml" with URL's and phrases that you need. This example show you how payloads can work.
Paste the "VcGrp_koopaking example.xml" in your command tree and save the "netflixURL.xml" in the payload folder of your VC.
To edit the payload double click the payloads\netflixURL.xml in the command tree.

When you say: "open netflix" VC ask you which video you prefer and you can say "I prefer a video form xyz"

What James said, there are many ways to do that, but this is a real simple way without any logic  ;D
***********  get excited and make things  **********

jitterjames

  • Administrator
  • Hero Member
  • *****
  • Posts: 7714
  • Karma: 116
    • View Profile
    • VoxCommando
Re: Make that voice commando ask a question
« Reply #7 on: May 17, 2013, 05:51:14 PM »
Code: [Select]
<?xml version="1.0" encoding="utf-16"?>
<commandGroup open="True" name="koopaking example" enabled="True" prefix="" priority="0" requiredProcess="" description="">
  <command id="466" name="open netflix" enabled="true" alwaysOn="False" confirm="False" requiredConfidence="0" loop="False" loopDelay="0" loopMax="0" description="">
    <action>
      <cmdType>TTS.Speak</cmdType>
      <cmdString>wich kind of video would you prefer?</cmdString>
      <cmdRepeat>1</cmdRepeat>
    </action>
    <phrase>open netflix</phrase>
  </command>
  <command id="481" name="load video category from netflix" enabled="true" alwaysOn="False" confirm="False" requiredConfidence="0" loop="False" loopDelay="0" loopMax="0" description="">
    <action>
      <cmdType>TTS.Speak</cmdType>
      <cmdString>I understand, you prefer videos from {1}</cmdString>
      <cmdRepeat>1</cmdRepeat>
    </action>
    <action>
      <cmdType>Launch.OpenURL</cmdType>
      <cmdString>{1}</cmdString>
      <cmdRepeat>1</cmdRepeat>
    </action>
    <phrase>I prefer a video from, let me see a video of</phrase>
    <payloadFromXML phraseOnly="False" use2partPhrase="False" phraseConnector="by" Phrase2wildcard="anyone">payloads\netflixURL.xml</payloadFromXML>
  </command>
</commandGroup>

Kalle's group, you might find it a bit easier to copy and paste from here directly to tree, instead of downloading the xml...
But the payload file you will need to download and save to the correct folder.

koopaking

  • Jr. Member
  • **
  • Posts: 6
  • Karma: 0
    • View Profile
Re: Make that voice commando ask a question
« Reply #8 on: May 19, 2013, 03:35:23 PM »
Thank you very much to the both of you.

Thanks

maxwel

  • Jr. Member
  • **
  • Posts: 39
  • Karma: 1
    • View Profile
Re: Make that voice commando ask a question
« Reply #9 on: February 06, 2014, 12:59:34 PM »
Is this also possible with 1channel ?

grtz

Max

jitterjames

  • Administrator
  • Hero Member
  • *****
  • Posts: 7714
  • Karma: 116
    • View Profile
    • VoxCommando
Re: Make that voice commando ask a question
« Reply #10 on: February 06, 2014, 11:28:56 PM »
???

maxwel

  • Jr. Member
  • **
  • Posts: 39
  • Karma: 1
    • View Profile
Re: Make that voice commando ask a question
« Reply #11 on: February 07, 2014, 01:43:22 AM »
I mean, can I also use this command for addon 1channel, if i replace netflix with 1channel addon?

grtz

jitterjames

  • Administrator
  • Hero Member
  • *****
  • Posts: 7714
  • Karma: 116
    • View Profile
    • VoxCommando
Re: Make that voice commando ask a question
« Reply #12 on: February 07, 2014, 10:39:55 AM »
The command above opens webpages in a web browser, using the Launch action, by specifying the URL of the web page you want to open.

I guess that Channel1 is probably an addon for XBMC, so I don't think you can open Channel1 in a web browser using an URL.

If you would like an example of launching an addon in XBMC Frodo, take a look at the command that comes with the standard VC English configuration for Frodo.  Look in the group "XBMC ADDONS" for the command "Download Subtitles".  Most likely you can use this action and you only need to change the id from
Code: [Select]
script.xbmc.subtitles to whatever the correct ID is for Channel1