Notice: This forum has been recovered from an old backup, so some content, links, and dates may be outdated. The forum is currently read-only while we restore sign-in and registration functionality. Details

If you find this forum valuable and would like to help keep it online, donations to help cover hosting and domain costs are greatly appreciated, but never expected. You can support the forum through Buy Me a Coffee or Ko-fi. Thank you for helping preserve the EventGhost community.

Vox Commando - Voice Commands

If you have a question or need help, this is the place to be.
Post Reply

What Language are you using VoxCommando with?

English
6
33%
French
0
No votes
German
7
39%
Swiss-German
0
No votes
Italian
1
6%
Spanish
2
11%
Dutch
0
No votes
Other
2
11%
 
Total votes: 18

User avatar
jitterjames
Experienced User
Posts: 677
Joined: Thu Aug 13, 2009 4:36 pm
Location: Quebec, Canada
Contact:

Re: Vox Commando - Voice Commands

Post by jitterjames »

I'm not quite clear on which part you need help with.

1) creating the artist.xml file that contains a list of all your artists, albums and songs, that Vox uses.

or

2) assuming vox has successfully generated an event with an artist as the payload, getting eventGhost and XBMC to actually load and play that artist.

Either way I'm not sure I can help since I don't use XBMC (always crashes on my machine for some reason) but lets at least narrow it down and go from there.


EDIT:
if you are trying to accomplish #1, and I think you are, then this link might be a good place to start.
http://wiki.xbmc.org/?title=Import_-_Export_Library

If XBMC can already export library data to xml format, then you don't need to worry about SQL, we just need to transform the xml into a format that voxCommando can understand. If you send me a sample of the xml that XBMC generates I might be able to do something with it.

That still leaves problem #2, and I have no idea if XBMC even supports this.
Last edited by jitterjames on Fri Apr 09, 2010 7:46 pm, edited 1 time in total.
User avatar
jitterjames
Experienced User
Posts: 677
Joined: Thu Aug 13, 2009 4:36 pm
Location: Quebec, Canada
Contact:

Re: Vox Commando - Voice Commands

Post by jitterjames »

RickG wrote:I created an XML file for XBMC. Ultimately I would like to have Vox Commando process a query to play a artist, but this would require a SQL query to query the XBMC database and I'm not familar with SQL. Anyone have ideas on how to do this?
Once you get it working, it would be excellent if you could post a youtube video at some point.
Ize
Posts: 14
Joined: Mon Apr 12, 2010 7:41 am

Re: Vox Commando - Voice Commands

Post by Ize »

Hey James thanks for the awesome programm! :D

I've been playing around with it(damn python scripting :P) the whole weekend and finally got payloads etc to work :D

It's kinda satisfying shouting "PC ON!!!" into the room and my netbook wakes up my pc via wake on lan :lol:

I'd also be interested in the XBMC stuff since i want to use Vox Commando to control my HTPC :)
User avatar
jitterjames
Experienced User
Posts: 677
Joined: Thu Aug 13, 2009 4:36 pm
Location: Quebec, Canada
Contact:

Re: Vox Commando - Voice Commands

Post by jitterjames »

yay! I'm always happy to hear that new people are enjoying the program.

I'm also always happy to help if I can. If you can give me more information about what you are trying to accomplish or what you are having troubles with, I'll see what I can do.

Since there are 2 of you now, I've installed xbmc on a spare machine and will mess around with it a bit.

If you are already controlling xbmc with a remote via eventGhost, then it should be very easy to add VoxCommando events to your EG macros that you've already set up.

Are you specifically interested in requesting music by name? (artist, album, song, genre)

Also, if you have the experience, is there anything I need to add to xbmc to be able to control it from EventGhost or do I just need to add the xbmc plugin to eventGhost?

cheers

(also feel free to make feature requests - I can't promise that I'll use them but ideas are always welcome)
Ize
Posts: 14
Joined: Mon Apr 12, 2010 7:41 am

Re: Vox Commando - Voice Commands

Post by Ize »

I control XBMC by an MCE Remote right now using the XBMC Plugin and it works fine(mostly)

I'm really interested in requesting movies / series & episodes by name(dunno how it would work for series tho)

I know that XBMC can search for titles ctrl+f? and if it has multiple matches it'll show a selection list(which could then work with your commands "down 2" "ok" etc.

I haven't gotten it to export the xmls correctly tho, im using the alaska skin tho... so maybe i fucked something up :lol:
User avatar
jitterjames
Experienced User
Posts: 677
Joined: Thu Aug 13, 2009 4:36 pm
Location: Quebec, Canada
Contact:

Re: Vox Commando - Voice Commands

Post by jitterjames »

I also tried to export library to xml from within xbmc and it seems to produce an empty file. I don't know if I'm doing something wrong here or if it's broken.

xbmc is using sqlite for its database which is good, since I already know how to tap into that. I could create a tool to read the xbmc data and convert it to the xml format that voxCommando uses.

the problem I'm having is in trying to figure out how to control xbmc from eventghost and to request songs by artists etc. I have made some progress. I'll let you know when I've got something more concrete on that front. the current xbmc plugin for eventghost only supports simple commands, but I think I might be able to extend it.

I could also try the ctrl-f method but I think it may lead to erratic behaviour. We'll see.

Can I assume that you are currently able to do all the things with vox that you can do with your mce remote?
User avatar
jitterjames
Experienced User
Posts: 677
Joined: Thu Aug 13, 2009 4:36 pm
Location: Quebec, Canada
Contact:

Re: Vox Commando - Voice Commands

Post by jitterjames »

Ize wrote:
I know that XBMC can search for titles ctrl+f? and if it has multiple matches it'll show a selection list(which could then work with your commands "down 2" "ok" etc.
I tried ctrl-f and it doesn't seem to work. let me know if you can figure out the key for this command.
Ize
Posts: 14
Joined: Mon Apr 12, 2010 7:41 am

Re: Vox Commando - Voice Commands

Post by Ize »

Sorry, the ctrl+f thing was from somewhere else.

The search function is kinda hidden in the alaska skin, when you are in the movies section press up to show the menu and choose the second option from the right "Title Search".

It will then return a list of all found movies / actors that match your request

i guess with other skins its similiar just try pressing up/down/left/right to show the context menu
RickG
Posts: 2
Joined: Fri Apr 09, 2010 5:31 pm

Re: Vox Commando - Voice Commands

Post by RickG »

I was never able to get the XBMC music export to work propery. I always end up with an empty file.

My idea was to use Vox commando to listen to a phrase "play artist" and everything after the word "artist" would be sent to a smart playlist.

VoxCommando would send the data to Eventghost. Then using the phython capabilities create or edit the smartplaylist file adding the artist to one of the rules for a smart playlist. Once the file has been execute the smart playlist.

Voice.xps
<smartplaylist>
<name>Voice</name>
<match>all</match>
<rule field="artist" operator="is">u2</rule>
</smartplaylist>


To execute the smart playlist I modified my keyboard.xml file to assign the number 5 button to a command to execute the playlist.

Keyboard.xml
<five>XBMC.PlayMedia(C:\Users\xbox\AppData\Roaming\XBMC\userdata\playlists\music\voice.xsp)</five>


My problem is I'm not sure how to get the voice data from VoxCommando into Eventghost. Do I need the artist data in VoxCommando or can I simply pass this information to eventghost? The other issue is I don't know python!

I beleive I am very close and could this approach could be used for other functions within xbmc.
User avatar
jitterjames
Experienced User
Posts: 677
Joined: Thu Aug 13, 2009 4:36 pm
Location: Quebec, Canada
Contact:

Re: Vox Commando - Voice Commands

Post by jitterjames »

The search function is kinda hidden in the alaska skin, when you are in the movies section press up to show the menu and choose the second option from the right "Title Search".
hmmm, the problem is that it's inconsistent. What arrow you press to get the menu depends on what view you are using. If you are in list mode you press left, and if you are in thumbnails you must press up.

I have some ideas though for something more sophisticated using smart playlists that we generate on the fly (by writing to a file) and then load in xbmc. I know it works for music and I'm pretty sure it will work well for movies.

for TV, would it work for you if you said for example: "watch tv lost" and it just started playing episodes of lost, starting with the next unwatched episode? Because I think I may be able to get that going. I think it would be pretty cool too...
Last edited by jitterjames on Mon Apr 12, 2010 8:24 pm, edited 2 times in total.
User avatar
jitterjames
Experienced User
Posts: 677
Joined: Thu Aug 13, 2009 4:36 pm
Location: Quebec, Canada
Contact:

Re: Vox Commando - Voice Commands

Post by jitterjames »

My idea was to use Vox commando to listen to a phrase "play artist" and everything after the word "artist" would be sent to a smart playlist.
rickG: I have come to the same conclusion. The only solution that I can find is to use a smart playlist. I have also found that exporting xml from xbmc does not work (empty). I have a solution for this (planned) but it will take some time (a few days?)

Getting the artist name into eventghost is very easy since vox is designed to do just this, by using payloads.

the first thing we need to do though is to create a file in the vox directory called "artists.xml". If you look at the original vox zip file you will see that it has this file in it.

It contains 1 album and it looks like this:

Code: Select all

<?xml version='1.0'?>
<root>
   <Artists>
      <Name>Ali Farka Tour&#233; with Ry Cooder</Name>
</Artists>
  <Albums>
      <Albumname>Talking Timbuktu</Albumname>
  </Albums>
  <Songs>
       <Title>Bonde</Title>
       <Title>Soukora</Title>
       <Title>Gomni</Title>
       <Title>Sega</Title>
       <Title>Amandrai</Title>
       <Title>Lasidan</Title>
       <Title>Keito</Title>
       <Title>Banga</Title>
       <Title>Ai Du</Title>
       <Title>Diaraby</Title>
  </Songs>
</root>
for now just edit it in notepad and enter some artists and make sure to maintain the format of the xml.

Code: Select all

...
<Artists>
      <Name>Ali Farka Tour&#233; with Ry Cooder</Name>
      <Name>The Beatles</Name>
      <Name>The Shins</Name>
</Artists>
...
we will use this to test vox / eventghost / xbmc

go into vox options and make sure the artist option is checked and put whatever word you want to say first (usually "artist").

restart vox and you should be able to say "artist the shins" with the result of an event in eventghost called "artist" with a payload of "the shins"

let me know if you get this far...
User avatar
jitterjames
Experienced User
Posts: 677
Joined: Thu Aug 13, 2009 4:36 pm
Location: Quebec, Canada
Contact:

Re: Vox Commando - Voice Commands

Post by jitterjames »

I have a working solution. so far I am only doing tv shows. this is as good a place to start as any.

here's what i've put into the voxcommando voicecommands.xml
you have to spell the show names correctly but upper or lower case doesn't seem to matter

Code: Select all

    <commandGroup name="xbmc tv shows">
        <command name="tvshow">
            <phrase>tv show</phrase>
            <payloadList>24,bored to death,30 rock,breaking bad,burn notice</payloadList>
        </command>
    </commandGroup>
and here's the macro for eventghost

Code: Select all

<?xml version="1.0" encoding="UTF-8" ?>
<EventGhost Version="1436">
    <Macro Name="tv" Expanded="True">
        <Event Name="Broadcast.tvshow" />
        <Action>
            EventGhost.PythonScript(u'eg.globals.searchstring=eg.event.payload\nprint eg.globals.searchstring')
        </Action>
        <Action>
            FileOperations.Write(2, u'<?xml version="1.0" encoding="UTF-8" standalone="yes" ?>\n<smartplaylist type="episodes">\n    <name>tv</name>\n    <match>all</match>\n    <rule field="tvshow" operator="is">{eg.globals.searchstring}</rule>\n    <rule field="playcount" operator="lessthan">1</rule>\n    <order direction="ascending">airdate</order>\n</smartplaylist>', u'C:\\voxtemp.xsp', 0, 0, False, False, False, 'cp1252')
        </Action>
        <Action>
            XBMC.LoadVoxPlaylist()
        </Action>
    </Macro>
</EventGhost>
that creates a smart playlist for unwatched episodes of whatever show you said. it stores it in
c:\voxtemp.xsp

then you just need to load that smart playlist... you have outlined one method by remapping a key. I modified the xbmc plugin and added a new command which does the trick. It's a pretty ugly hack but it works. replace the __init__.py file in eventghost\plugins\xbmc with the attached file and then you can access the command like this:

Code: Select all

<?xml version="1.0" encoding="UTF-8" ?>
<EventGhost Version="1436">
    <Action>
        XBMC.LoadVoxPlaylist()
    </Action>
</EventGhost>
complicated enough for you? :wink:
Attachments
__init__.py
replace the file in ...eventghost\plugins\xbmc
(10.73 KiB) Downloaded 239 times
Ize
Posts: 14
Joined: Mon Apr 12, 2010 7:41 am

Re: Vox Commando - Voice Commands

Post by Ize »

Haha awesome, i'll try it tomorrow :D
Ize
Posts: 14
Joined: Mon Apr 12, 2010 7:41 am

Re: Vox Commando - Voice Commands

Post by Ize »

i can't get the eventghost makro to work :(

Code: Select all

20:28:54   Broadcast.tvshow 'Knight Rider'
20:28:54      Vox Test
20:28:54         u'eg.globals.searchstring=eg.event.payload\nprint eg.globals.searchstring'
20:28:54         FileOperations.Write(2, u'<?xml version="1.0" encoding="UTF-8" standalone="yes" ?>\n<smartplaylist type="episodes">\n    <name>tv</name>\n    <match>all</match>\n    <rule field="tvshow" operator="is">{eg.globals.searchstring}</rule>\n    <rule field="playcount" operator="lessthan">1</rule>\n    <order direction="ascending">airdate</order>\n</smartplaylist>', u'C:\\voxtemp.xsp', 0, 0, False, False, False, 'cp1252'
20:28:54            Fehler in Befehl: "FileOperations.Write(2, u'<?xml version="1.0" encoding="UTF-8" standalone="yes" ?>\n<smartplaylist type="episodes">\n    <name>tv</name>\n    <match>all</match>\n    <rule field="tvshow" operator="is">{eg.globals.searchstring}</rule>\n    <rule field="playcount" operator="lessthan">1</rule>\n    <order direction="ascending">airdate</order>\n</smartplaylist>', u'C:\\voxtemp.xsp', 0, 0, False, False, False, 'cp1252'"
20:28:54            Traceback (most recent call last) (1262):
20:28:54              File "<string>", line 1
20:28:54                FileOperations.Write(2, u'<?xml version="1.0" encoding="UTF-8" standalone="yes" ?>\n<smartplaylist type="episodes">\n    <name>tv</name>\n    <match>all</match>\n    <rule field="tvshow" operator="is">{eg.globals.searchstring}</rule>\n    <rule field="playcount" operator="lessthan">1</rule>\n    <order direction="ascending">airdate</order>\n</smartplaylist>', u'C:\\voxtemp.xsp', 0, 0, False, False, False, 'cp1252'
20:28:54                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                              ^
20:28:54            SyntaxError: unexpected EOF while parsing
20:28:59   Broadcast.tvshow 'Dexter'
20:28:59      Vox Test
20:28:59         u'eg.globals.searchstring=eg.event.payload\nprint eg.globals.searchstring'
20:28:59         FileOperations.Write(2, u'<?xml version="1.0" encoding="UTF-8" standalone="yes" ?>\n<smartplaylist type="episodes">\n    <name>tv</name>\n    <match>all</match>\n    <rule field="tvshow" operator="is">{eg.globals.searchstring}</rule>\n    <rule field="playcount" operator="lessthan">1</rule>\n    <order direction="ascending">airdate</order>\n</smartplaylist>', u'C:\\voxtemp.xsp', 0, 0, False, False, False, 'cp1252'
20:28:59            Fehler in Befehl: "FileOperations.Write(2, u'<?xml version="1.0" encoding="UTF-8" standalone="yes" ?>\n<smartplaylist type="episodes">\n    <name>tv</name>\n    <match>all</match>\n    <rule field="tvshow" operator="is">{eg.globals.searchstring}</rule>\n    <rule field="playcount" operator="lessthan">1</rule>\n    <order direction="ascending">airdate</order>\n</smartplaylist>', u'C:\\voxtemp.xsp', 0, 0, False, False, False, 'cp1252'"
20:28:59            Traceback (most recent call last) (1262):
20:28:59              File "<string>", line 1
20:28:59                FileOperations.Write(2, u'<?xml version="1.0" encoding="UTF-8" standalone="yes" ?>\n<smartplaylist type="episodes">\n    <name>tv</name>\n    <match>all</match>\n    <rule field="tvshow" operator="is">{eg.globals.searchstring}</rule>\n    <rule field="playcount" operator="lessthan">1</rule>\n    <order direction="ascending">airdate</order>\n</smartplaylist>', u'C:\\voxtemp.xsp', 0, 0, False, False, False, 'cp1252'
20:28:59                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                              ^
20:28:59            SyntaxError: unexpected EOF while parsing
20:29:03   Broadcast.tvshow 'Spartacus'
20:29:03      Vox Test
20:29:03         u'eg.globals.searchstring=eg.event.payload\nprint eg.globals.searchstring'
20:29:03         FileOperations.Write(2, u'<?xml version="1.0" encoding="UTF-8" standalone="yes" ?>\n<smartplaylist type="episodes">\n    <name>tv</name>\n    <match>all</match>\n    <rule field="tvshow" operator="is">{eg.globals.searchstring}</rule>\n    <rule field="playcount" operator="lessthan">1</rule>\n    <order direction="ascending">airdate</order>\n</smartplaylist>', u'C:\\voxtemp.xsp', 0, 0, False, False, False, 'cp1252'
20:29:03            Fehler in Befehl: "FileOperations.Write(2, u'<?xml version="1.0" encoding="UTF-8" standalone="yes" ?>\n<smartplaylist type="episodes">\n    <name>tv</name>\n    <match>all</match>\n    <rule field="tvshow" operator="is">{eg.globals.searchstring}</rule>\n    <rule field="playcount" operator="lessthan">1</rule>\n    <order direction="ascending">airdate</order>\n</smartplaylist>', u'C:\\voxtemp.xsp', 0, 0, False, False, False, 'cp1252'"
20:29:03            Traceback (most recent call last) (1262):
20:29:03              File "<string>", line 1
20:29:03                FileOperations.Write(2, u'<?xml version="1.0" encoding="UTF-8" standalone="yes" ?>\n<smartplaylist type="episodes">\n    <name>tv</name>\n    <match>all</match>\n    <rule field="tvshow" operator="is">{eg.globals.searchstring}</rule>\n    <rule field="playcount" operator="lessthan">1</rule>\n    <order direction="ascending">airdate</order>\n</smartplaylist>', u'C:\\voxtemp.xsp', 0, 0, False, False, False, 'cp1252'
20:29:03                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                              ^
20:29:03            SyntaxError: unexpected EOF while parsing
User avatar
jitterjames
Experienced User
Posts: 677
Joined: Thu Aug 13, 2009 4:36 pm
Location: Quebec, Canada
Contact:

Re: Vox Commando - Voice Commands

Post by jitterjames »

hmmm. I can't make much sense of that output. Maybe it's a copy/paste problem?

make sure you are using an up to date version of EG (I'm using 3.7.r1436)
backup your eg xml macro file and then load the attached one and see what you get.

you could also just do some tests to make sure that file operations plugin works and is able to write to the file C:\voxtemp.xsp with some simple text.

or if you want you can send me your eg xml file and I'll try to figure out what's going on.

the good news is that I'm making good progress on reading and reformatting the data from xbmc so that vox will know exactly what artists/albums/songs/movies and TvSeries are in you library, so you won't have to enter them by hand.

Also I have all these macros working so you need only persevere a bit and it'll be worth it.

One problem I can't solve is getting xbmc to load files with certain "internalional" characters. Once we get further along, maybe someone else will be able to help with that.

J
Attachments
voxBMC.xml
(4.54 KiB) Downloaded 183 times
Post Reply