VoxCommando

VoxNastics (User Guides and Mods) => XML Exchange => Topic started by: jitterjames on June 19, 2013, 12:23:36 PM

Title: Coming Home - computer offers music, then offers movies (XBMC)
Post by: jitterjames on June 19, 2013, 12:23:36 PM
Here is code for something similar to what I have done in my Youtube "scenario" video where I am coming home from work:

video:


Here is the XML code which you can try yourself.  Select all the text in the code box, copy it (ctrl-c), open your VC tree editor, right click, and select paste to put this group into the tree.

Code: [Select]
<?xml version="1.0" encoding="utf-16"?>
<commandGroup open="True" name="Come home offer music then movies" enabled="True" prefix="" priority="3" requiredProcess="" description="">
  <command id="218" name="Welcome Home 1 offer music" enabled="true" alwaysOn="False" confirm="False" requiredConfidence="0" loop="False" loopDelay="0" loopMax="0" description="">
    <action>
      <cmdType>TTS.SpeakSync</cmdType>
      <cmdString>Welcome back puny human, The time is {ShortTime}</cmdString>
      <cmdRepeat>1</cmdRepeat>
    </action>
    <action>
      <cmdType>TTS.SpeakSync</cmdType>
      <cmdString>Would you like to listen to some music?</cmdString>
      <cmdRepeat>1</cmdRepeat>
    </action>
    <action>
      <cmdType>VC.TellVox</cmdType>
      <cmdString>confirm play music</cmdString>
      <cmdRepeat>1</cmdRepeat>
    </action>
    <phrase>honey I'm home</phrase>
    <event>some event that is triggered when you get home</event>
  </command>
  <command id="233" name="++ Welcome Home 2 offer movie" enabled="true" alwaysOn="False" confirm="False" requiredConfidence="0" loop="False" loopDelay="0" loopMax="0" description="">
    <action>
      <cmdType>VC.Pause</cmdType>
      <cmdString>200</cmdString>
      <cmdRepeat>1</cmdRepeat>
    </action>
    <action>
      <cmdType>TTS.SpeakSync</cmdType>
      <cmdString>In that case, how about a movie?</cmdString>
      <cmdRepeat>1</cmdRepeat>
    </action>
    <action>
      <cmdType>VC.TellVox</cmdType>
      <cmdString>confirm watch movie</cmdString>
      <cmdRepeat>1</cmdRepeat>
    </action>
    <event>Confirm.Cancel.confirm play music</event>
  </command>
  <command id="819" name="confirm play music" enabled="true" alwaysOn="False" confirm="True" requiredConfidence="0" loop="False" loopDelay="0" loopMax="0" description="LMD0C = all channel stereo">
    <action>
      <cmdType>XJson.Btn.KB</cmdType>
      <cmdString>x</cmdString>
      <cmdRepeat>1</cmdRepeat>
    </action>
    <action>
      <cmdType>TTS.SpeakSync</cmdType>
      <cmdString>OKAY, Let's get this party started</cmdString>
      <cmdRepeat>1</cmdRepeat>
    </action>
    <action>
      <cmdType>XJson.ExecBuiltin</cmdType>
      <cmdString>PlayerControl(PartyMode(music))</cmdString>
      <cmdRepeat>1</cmdRepeat>
    </action>
    <phrase>confirm play music</phrase>
  </command>
  <command id="825" name="confirm watch movie" enabled="true" alwaysOn="False" confirm="True" requiredConfidence="0" loop="False" loopDelay="0" loopMax="0" description="LMD0C = all channel stereo">
    <action>
      <cmdType>XJson.Btn.KB</cmdType>
      <cmdString>x</cmdString>
      <cmdRepeat>1</cmdRepeat>
    </action>
    <action>
      <cmdType>TTS.Speak</cmdType>
      <cmdString>Good idea.  I'll select 10.  If you don't like the first one just skip ahead.</cmdString>
      <cmdRepeat>1</cmdRepeat>
    </action>
    <action>
      <cmdType>XJson.Raw</cmdType>
      <cmdString>Player.Open&amp;&amp;"item": {"file": "special://profile/playlists/video/RandomMovie.xsp"}</cmdString>
      <cmdRepeat>1</cmdRepeat>
    </action>
    <phrase>confirm watch movie</phrase>
  </command>
  <command id="745" name="do confirm (always on)" enabled="true" alwaysOn="True" confirm="False" requiredConfidence="0" loop="False" loopDelay="0" loopMax="0" description="">
    <action>
      <cmdType>VC.ConfirmYes</cmdType>
      <cmdString />
      <cmdRepeat>1</cmdRepeat>
    </action>
    <phrase>Go ahead, Yes please, sounds good, that would be lovely</phrase>
    <phrase optional="true">Bella</phrase>
  </command>
</commandGroup>
Title: Re: Coming Home - computer offers music, then offers movies (XBMC)
Post by: jitterjames on June 19, 2013, 12:24:24 PM
How it works:

Please see the attached image below (click to enlarge the image).

1) This starts the sequence.
- You can use a voice command  like "honey I'm home", and/or use an external event like a motion sensor to get the ball rolling...
- This command will play the TTS asking if you want to listen to music and then will use tellvox to start the command (2) "confirm play music"
Note: we can't use an event to trigger command #2 because an event does not enforce the requirement to "confirm" a command.  So we must use tellvox to emulate giving a voice command.

2) This command will start playing music (XBMC party mode), but only if "confirmed".
-  Depending on your option settings, it will wait for a while to see if you confirm or not.
-  If you specifically say "no thanks" the following event will be fired: Confirm.Cancel.confirm play music
- That event starts command 3 "++ Welcome Home 2 offer movie"
- I found that I needed to use the ++ which runs the command in a new thread in order for this to work... I won't go into it, just leave the ++ at the beginning of the command name!

3) Same idea as command 1, but this time offers to play random movies and uses VC.TellVox to initiate command 4.

4) Waits for confirmation
- if confirmed it will open the smart playlist in XBMC called "RandomMovie.xsp"
Title: Re: Coming Home - computer offers music, then offers movies (XBMC)
Post by: Mace on June 19, 2013, 07:01:21 PM
Awesome!
I love it, great demo.

lol even the dog gets a mention in the credits.

Title: Re: Coming Home - computer offers music, then offers movies (XBMC)
Post by: Kalle on June 19, 2013, 07:16:31 PM
Perfect explanation! Easy to follow and recreate.  ::bow :clap
Title: Re: Coming Home - computer offers music, then offers movies (XBMC)
Post by: nime5ter on June 20, 2013, 06:21:25 PM
lol even the dog gets a mention in the credits.

Yep, "even the dog." But how about the subtle artistry of that uncredited camera operator -- pretty impressive, eh?
Title: Re: Coming Home - computer offers music, then offers movies (XBMC)
Post by: jitterjames on June 20, 2013, 06:22:43 PM
What camera operator?
Title: Re: Coming Home - computer offers music, then offers movies (XBMC)
Post by: Kalle on June 20, 2013, 07:12:36 PM
Quote
Yep, "even the dog." But how about the subtle artistry of that uncredited camera operator -- pretty impressive, eh?

  ::yikes ::console

Quote
lol even the dog gets a mention in the credits.

 ::club
Title: Re: Coming Home - computer offers music, then offers movies (XBMC)
Post by: maxwel on February 12, 2014, 04:12:02 PM
Hey James, I was watching your youtube demo about VoxCommando - Scenario: Coming Home from Work! i realy like your command and phrases! could you share your full command plz?

Grtz

Max
Title: Re: Coming Home - computer offers music, then offers movies (XBMC)
Post by: jitterjames on February 12, 2014, 04:42:34 PM
I'm afraid not.  For one thing I no longer have the commands that I used in that demo, although I may have bits and variations that still worked for me in my real life.  For another thing my complete command tree is huge and I would need to pick through it very carefully to make sure I wan't uploading something private.
Title: Re: Coming Home - computer offers music, then offers movies (XBMC)
Post by: nime5ter on February 12, 2014, 10:39:23 PM
Apart from the xml James posted at the start of this thread, if you search the forum you will find a lot of the other commands as well.

For example, the Our Groceries commands in the video are very similar to those posted on the RoboB (Robo Browser) plugin thread.

The "remind me to walk the dog" command is also on the forum: http://voxcommando.com/forum/index.php?topic=1123.msg9446#msg9446
Title: Re: Coming Home - computer offers music, then offers movies (XBMC)
Post by: outlaw on April 03, 2014, 04:44:02 PM
hi james , this is james as well , great job btw:) I did your comeing home from work xml and it wont play my music or movies ive done
all I can think of, any advice would be great:)
Title: Re: Coming Home - computer offers music, then offers movies (XBMC)
Post by: nime5ter on April 03, 2014, 05:52:33 PM
Hi outlaw, welcome to the forum.

You may want to start by reviewing the forum support guidelines: http://voxcommando.com/forum/index.php?topic=1248.msg12801

Unfortunately, while you know what "I've done all I can think of" entails, we don't, which makes it difficult to suggest solutions. Also we don't know what version of VC you have installed, whether you already have VC working properly with XBMC, etc.

Please let us know more about your setup and exactly what you've tried, and then perhaps we can be of more use to you.
Title: Re: Coming Home - computer offers music, then offers movies (XBMC)
Post by: jitterjames on April 03, 2014, 09:48:42 PM
You really need to read this:

http://www.voxcommando.com/forum/index.php?topic=1248.0

and you can check out the Youtube Channel

https://www.youtube.com/channel/UC5bR_Jcv6lk3ubiNzdgOIGQ

and use the wiki:
http://voxcommando.com/mediawiki/index.php?title=Main_Page

Educate yourself.
Title: Re: Coming Home - computer offers music, then offers movies (XBMC)
Post by: outlaw on April 04, 2014, 12:07:08 PM
thanks nime5ter for the welcome.....i have vc version 1.1.9.1 .......i do xbmc working with vc to open and play my movies.....however it will not browse or
play my music.i thought there was a media monkey plugin for vc but theres not. ive watched jitters videos and tut but still cant get it to
do what i want.im even an i-t and still vc has me whooopt :bonk ....haha i just want to build commands to say something like...its work out time and the tts will
answer back and play music... just stuff like that... im sorry if i didnt explain this right
Title: Re: Coming Home - computer offers music, then offers movies (XBMC)
Post by: jitterjames on April 04, 2014, 12:35:58 PM
thanks nime5ter for the welcome.....i have vc version 1.1.9.1 .......i do xbmc working with vc to open and play my movies.....however it will not browse or play my music.
There are installation videos and wiki articles that tell you exactly how to set up VC for use with XBMC.  Read / follow them.  If VC works with your movies and not your music then you may not have XBMC set up correctly.  You will need to provide us with more information in order for us to help you.

i thought there was a media monkey plugin for vc but theres not.
This is incorrect.  Yes, VC can be used with mediamonkey, there is even a default configuration that is offered to you when you first install VC. MM is directly supported in VC1 as core actions, and there is a preset configuration that you can select when you install VoxCommando.  It is incredibly easy to set up.  VC2 supports MM as well but MM actions have been moved to a plugin instead of having the MM actions as part of the core program.

ive watched jitters videos and tut but still cant get it to do what i want.im even an i-t and still vc has me whooopt :bonk ....haha i just want to build commands to say something like...its work out time and the tts will answer back and play music... just stuff like that... im sorry if i didnt explain this right

It is highly unlikely that you've watched ALL the videos.  You may have watched some of them, but only you know which ones.  Have you looked at the wiki at all?  There is a huge amount of information on it, and there is a huge amount of information on the forum, and there is a huge amount of information in our videos.  We can't read it or watch it for you.  A massive amount of effort has gone into providing all this information.  But you have to make some effort to take advantage of it.  VoxCommando is not a little app for telling your friends where you will be having your coffee today.  It is a powerful, complex and extremely flexible program.  As such, there is going to be a learning curve.  That is just how it is.

Check out our youtube tutorials:


If you want to create your own commands I recommend that you watch tutorial "VoxCommando 1A Editing and Building Commands" and 1B

There is an area of the wiki dedicated to different types of installations including XBMC and MediaMonkey:
http://voxcommando.com/mediawiki/index.php?title=Installation
Title: Re: Coming Home - computer offers music, then offers movies (XBMC)
Post by: outlaw on April 04, 2014, 01:20:49 PM
MR.JITTER!!!.......I UNDERSTAND WHAT YOU ARE SAYING,AND ILL READ AND WATCH MORE VIDEOS,
HOWEVER, I AM NOT HAPPY WITH A FEW LINES IN YOU RESPONSE TO ME......LIKE YOU CANT WATCH THE VIDEOS FOR ME,
THAT WAS UNCALLED FOR! JUST CAUSE YOUR THE BUILDER OF VC DOESNT GIVE YOU THAT RIGHT TO TALK TO PEOPLE LIKE THAT!!!!

Title: Re: Coming Home - computer offers music, then offers movies (XBMC)
Post by: Kalle on April 04, 2014, 02:10:00 PM
I can't read "bad words" in the post from James only important hints - but you must understand that the programm is very flexible and it is easy to make a mistake in the configuration.

When you ask VC to play music from XBMC you will see in the VC history window the executed action events and if there is any action "orange" it show up an error. You can move your mouse over the event and then it will show up a info text what is happen with this action.
Did you change anything in the command groups?
If VC doesn't browse or play music it will find no item for the music - you can take a look in the VC main folder in XBMCpayloads folder if the music.xml has more than 0 KB, otherwise you must generate it first.
Title: Re: Coming Home - computer offers music, then offers movies (XBMC)
Post by: outlaw on April 05, 2014, 08:22:19 PM
thanks ..... I did do what jitter asked and that was read lots and watch more vids....I got it to work on my man room htpc but the main home  computer isn't still, but ill get it :)
and thanks for replying back....I do have one ?  can your media (songs) be in a folder on the desktop or do they have to be in the music folder to work?
I have my man room pc music on a ex drive and it works fine but the main pc done the same way doesnt
Title: Re: Coming Home - computer offers music, then offers movies (XBMC)
Post by: jitterjames on April 05, 2014, 08:42:35 PM
I have no idea whether you are talking about XBMC, MediaMonkey, iTunes, Windows Media Centre, JRiver Media Centre, or Mediaportal or some other program but no, in most cases it does not matter where your music is located.  The way that VoxCommando talks to each of these program is different, but in most cases VC is only requesting the music by an ID or by specifying the name of the song, artist, album etc. and VC does not care where the music is located.  Of course your media program needs to know where the music is located.
Title: Re: Coming Home - computer offers music, then offers movies (XBMC)
Post by: Kalle on April 05, 2014, 09:00:08 PM
It doesn't matter where your media is stored so long you has access on it with xbmc.
It is not really clear for me on which pc you have installed VC and on which XBMC or maybe both on each pc.
My native language is not english and it is possible that I understand something wrong.
Normaly you have one place where the media stuff is stored in a network, in this way any machine has access to the media data in the network.
Title: Re: Coming Home - computer offers music, then offers movies (XBMC)
Post by: lja on July 16, 2014, 07:25:13 PM
I would like to add code to the XML code in the first post as follows:

Should I choose movie and then decide "No Thanks", I would like the computer to respond "OK. Goodbye. See you later"

Any help will be appreciated. Thanks.

Title: Re: Coming Home - computer offers music, then offers movies (XBMC)
Post by: nime5ter on July 16, 2014, 08:49:42 PM
You can create a new command, triggered by a Confirm.Cancel event, much in the same way as the ++Welcome Home 2 Offer Movie command that already exists in that command group.

That is: If you start this scene and choose not to listen to music or watch a movie, you should then see an event appear in your history window:

Code: [Select]
Confirm.Cancel.confirm watch movie
"confirm watch movie" is the name of the command that you've just cancelled.

"Confirm.Cancel.[command name]" is a standard event that is generated in VC whenever a command that requires confirmation receives the order not to execute.

Code: [Select]
<?xml version="1.0" encoding="utf-16"?>
<!--VoxCommando 2.0.0.0-->
<command id="746" name="Bye for now" enabled="true" alwaysOn="False" confirm="False" requiredConfidence="0" loop="False" loopDelay="0" loopMax="0" description="">
  <action>
    <cmdType>TTS.Speak</cmdType>
    <params>
      <param>OK. Goodbye. See you later.|No problem. Bye for now.|OK. I'll talk to you later.</param>
    </params>
    <cmdRepeat>1</cmdRepeat>
  </action>
  <event>Confirm.Cancel.confirm watch movie</event>
</command>
Title: Re: Coming Home - computer offers music, then offers movies (XBMC)
Post by: lja on July 16, 2014, 10:05:26 PM
@nime5ter

Thanks. Works nicely.