[How To] Control Mediaportal with your voice using WSRmac

Discussion in 'other Input / Output interfaces' started by smnnekho, June 27, 2010.

  1. smnnekho
    • Team MediaPortal

    smnnekho Retired Team Member

    Joined:
    February 6, 2006
    Messages:
    507
    Likes Received:
    7
    Location:
    Germany
    Ratings:
    +7 / 0
    This thread is a work in progress...

    Some Time Ago i was fascinated by booyakasha's attemp to control Mediaportal via Voice MyVoice. I tried to help with the project until i switched to vista which was no longer supported.

    That's when i switched back to my MCE-remote and forgot about the whole thing for a while.

    Anyhow - the Speech Recognition capabilities of Vista and Windows 7 are in fact pretty remarkable and i recently discovered that the lack of macros has been corrected by the release of WSRmacros.

    The best thing is, that it even works in the localized language, meaning i (and more importantly my girlfriend who thinks this is all stupid anyways) can command in German.

    To avoid further misunderstandings, this is not going to be a plugin for MP. This thread should just collect Macros for the already and freely available WSRMacro extension for the inbuilt vista and win7 speech recognition. Everyone can download it via the following link and try it out...

    WSRmacros DOWNLOAD

    It allows you to build pretty simple "key-emulating" macros or little mor sophisticated XML macros to control and do things the inbuilt SpeechRec was not designed to do. It is also possible to include Javascript or VBscript - and i guess some other sciptlanguages too.


    This Thread should be a base for discussion on How to control Mediaportal with your voice, a collection of macros to do so and some other fancy stuff.


    Mediaportal

    What is working so far:

    Everything that you can control with your remote or keyboard + any given plugin screen you wanna go to (with the keyboard input plugin for custom shortcuts) can be accessed via one or multiple voice commands.

    Examples:

    ?Go ?to Homescreen | ?Go ?To ?My ?Music Playing Now | Skip back [0-99] Minutes etc.

    I can even access specific TV Channels by saying it's name (like ?Skip ?to ?Channel B B C)

    (The "?" means this part of the Command is optional)

    Inserting something into the OnScreen Keyboard. Like when in Youtube-search you can say "Insert [WHATEVER]" and it'll search fo that.


    Not yet working

    Unfortunatly, the actually coolest thing i can think of does not yet work: Interaction with Mediaportal Databases. So far i did not come up with any idea how to do something like "Play Music Artist Nirvana" or "Record The Simpsons"

    At least the Record That part could maybe be done by some 3rdparty sheduler like 4therecord - i'm not really sure if they support some kind of command line procedures though.

    It would be cool if this thread could lead to some "command line input / interaction"-plugin for MP so we can do this.



    Fancy Stuff

    That's Something i spent some more time on since it allows you to do some pretty neat things in combination with the inbuilt TTS engine. Some Examples of what i can already do:

    • Having a Conversation with my computer like "Hello Computer" and an appropriate spoken answer
    • Say Hello To [...] <-- this is like a wildcard, the computer will say hello (or something else) to the person you tols it to do
    • Read the News. <-- Via VBscript it is possible to scrape webcontent or RSS-Feed and than read it back to me
    • Search google for [...] <-- opens a websearch for whatever i said. also works for amazon, ebay or watever
    • What time / date is it <-- gues what it does (;
    • What's on TV now <-- rss-scraping again. Reads the Main channels and the programm currently running
    • what's on TV @ Primetime <-- pretty much the same thing
    • current lineup @ cinema
    • starting @ cinema this week
    • How is the Weather in [...] <-- computer reads the weather for the city you asked it for
    • Tell me a joke <-- tells a random joke and laughs afterwards (HAHAHA (-; ) (rss again)
    • What's the lates Tweet from [PERSON] <-- Does exatcly that, this would require a List of Persons including the appropriate adress defined in the macro though

    I Will upload my scripts later.
    As the WSR is localized they are all in german though. I'm not sure if i should/will translate them or if their syntax i clear enough everyone can do this on his own. In this thread there will be multiple scripts collected anyways (at least i hope though)

    I created a Google_Group everyone is free to join (it's empty right now though (-; )



    Voicecontrol for Mediaportal with WSRmacros | Google Groups

    Here are some other useful ressources:

    Windows Speech Recognition Macros - Home
    Rob's Rhapsody - Site Home - MSDN Blogs
    MS Speech ForumThe Windows Speech Recognition and Macro Forum
    ms-speech : Microsoft Speech Recognition
    emicrophones.com - WSRMacros: The User?s Guide (<-- costs 10 bucks but might be wort it for beginners)

    This is just a rough start to get the whole thing started. I will update the thread later (and in the future of course) and reformat it fo better readability.
     
    • Like Like x 4
  2. Google AdSense Guest Advertisement



    to hide all adverts.
  3. smnnekho
    • Team MediaPortal

    smnnekho Retired Team Member

    Joined:
    February 6, 2006
    Messages:
    507
    Likes Received:
    7
    Location:
    Germany
    Ratings:
    +7 / 0
    Examples:

    This a Syntax example how to pause the current playback:

    Code (Text):
    1.  
    2.  
    3. <?xml version="1.0" encoding="UTF-16"?>
    4. <speechMacros>
    5.  
    6.   <command>
    7.     <listenFor>Pause</listenFor>
    8.     <listenFor>Hold ?Playback</listenFor>
    9.     <listenFor>Resume ?Playback</listenFor>
    10.     <listenFor>Play</listenFor>
    11.     <listenFor>I need to pee</listenFor>
    12.     <listenFor>?I Returnd from peeing</listenFor>
    13.     <sendKeys>{u+0020}</sendKeys>
    14.   </command>
    15.  
    16. </speechMacros>
    17.  
    It is a very simple Keysend macro. Note that "Spacebar" equals to {u+0020} but it is the only exception from the standard sysntax. For the other keys you can just use "a" or "b", {ENTER}, {ESC}, {CTRL} or whatever.

    Example for Voice Interaction:

    Code (Text):
    1. <?xml version="1.0" encoding="UTF-16"?>
    2. <speechMacros>
    3.      <command>
    4.           <listenFor>?Computer, ?Why ?don't ?you say Hi to [...]</listenFor>
    5.           <speak>Hi {[...]}. I'm smnnekho's computer</speak>
    6.      </command>
    7.  
    8. </speechMacros>
    This would allow you to say "why don't you say hi to PERSON or just Computer, Say hi to PERSON and the computer speaks whats in the <speak> tag.

    Example for RSS Scraping:

    Code (Text):
    1.  
    2. <?xml version="1.0" encoding="UTF-16"?>
    3. <speechMacros>
    4.  
    5. <command>
    6. <listenFor>Was ist los in der Welt?</listenFor>
    7. <listenFor>Schlagzeilen von Welt Online</listenFor>
    8.  
    9. <speak>Aquiring Data...</speak>
    10.  
    11. <script language="JScript">
    12. <![CDATA[
    13. var xml_doc = new ActiveXObject("Microsoft.XMLDOM");
    14. xml_doc.async = false;
    15. xml_doc.load("http://www.welt.de/?service=Rss");
    16. var titles = xml_doc.getElementsByTagName("title");
    17. var descriptions = xml_doc.getElementsByTagName("description");
    18.  
    19. Application.Speak(titles.item(2).text);
    20. Application.Speak(descriptions.item(2).text);
    21.  
    22. Application.Speak(titles.item(3).text);
    23. Application.Speak(descriptions.item(3).text);
    24.  
    25. Application.Speak(titles.item(4).text);
    26. Application.Speak(descriptions.item(4).text);
    27.  
    28. Application.Speak(titles.item(5).text);
    29. Application.Speak(descriptions.item(5).text);
    30. ]]>
    31. </script>
    32. </command>
    33. </speechMacros>
    34.  
    35.  
    This would be me asking for news and let the computer read them back for me. This is another downside: i havent figured out a way to stop a macros execution. So the computer wouldn't stop reading until headline 5 in this example.

    i solved this by seperating every headline with an additional command like "read headline 2, 3, 4 etc...
     
  4. smnnekho
    • Team MediaPortal

    smnnekho Retired Team Member

    Joined:
    February 6, 2006
    Messages:
    507
    Likes Received:
    7
    Location:
    Germany
    Ratings:
    +7 / 0
    Some other MP-controlling examples (not yet translated)

    Code (Text):
    1.   <command>
    2.     <listenFor>Auswählen</listenFor>
    3.     <listenFor>Enter</listenFor>
    4.     <sendKeys>{ENTER}</sendKeys>
    5.   </command>
    6.  
    7.  
    8.   <command>
    9.     <listenFor>Zurück</listenFor>
    10.     <sendKeys>{ESC}</sendKeys>
    11.   </command>
    12.  
    13.   <command>
    14.     <listenFor>Vollbild</listenFor>
    15.     <sendKeys>x</sendKeys>
    16.   </command>
    17.  
    18.   <command>
    19.     <listenFor>?aktuelles ?programm aufnehmen</listenFor>
    20.     <listenFor>?aktuelle ?Sendung aufnehmen</listenFor>
    21.     <sendKeys>r</sendKeys>
    22.   </command>
    23.  
    24.   <command>
    25.     <listenFor>Play</listenFor>
    26.     <listenFor>abspielen</listenFor>
    27.     <sendKeys>p</sendKeys>
    28.   </command>
    29.  
    30.   <command>
    31.     <listenFor>STOP</listenFor>
    32.     <listenFor>Abspielen beenden</listenFor>
    33.     <sendKeys>b</sendKeys>
    34.   </command>
    35.  
    36.   <command>
    37.     <listenFor>?Zeige Informationen</listenFor>
    38.     <sendKeys>{F3}</sendKeys>
    39.   </command>
     
  5. smnnekho
    • Team MediaPortal

    smnnekho Retired Team Member

    Joined:
    February 6, 2006
    Messages:
    507
    Likes Received:
    7
    Location:
    Germany
    Ratings:
    +7 / 0
    ... you'll never know how much Space you'll need
     
  6. vecnar

    vecnar Portal Pro

    Joined:
    April 21, 2008
    Messages:
    129
    Likes Received:
    10
    Ratings:
    +10 / 0
    Home Country:
    Ireland Ireland
    I am glad that somebody took over the project which would work in Windows7 and vista.
    I will not be able to test it for next few weeks as i am moving a house and quiet busy with packing :)
    But i will definitely try it.
     
  7. msj33
    • Premium Supporter

    msj33 MP Donator

    Joined:
    November 30, 2005
    Messages:
    471
    Likes Received:
    41
    Ratings:
    +69 / 3
    Home Country:
    England England
    This looks like an awsome project.

    And I can see that there has already been put a lot of effort into this.

    Have a questions - Is there a Standard initial phrase to enable the Speech control?

    Like: "Computer.....pause" & "Computer.........play"

    If not, it would be nice to have...........Because it would be annoying, if someone mentiones the word "stop" by accident while watching a movie, and then the movie stops.

    I have joined your google group under the name Stensgaard - will keep following this thread.

    Will also be happy to join an alpha test group - Just sent me a personal message.

    Have some suggestions:

    What about renameing the Project to MyVoice 2.0 Alpha? (WSRmacro is not a logic name)
    A better How-To than the one above (At the moment you cannot call it a How-To - Ease of installation is not there yet - unlss you want some testers on this app first????)

    But still - Great work so far - Keep it up.........Have also been waiting for a Win7 voice recognition tool for MP:)
     
  8. smnnekho
    • Team MediaPortal

    smnnekho Retired Team Member

    Joined:
    February 6, 2006
    Messages:
    507
    Likes Received:
    7
    Location:
    Germany
    Ratings:
    +7 / 0
    There seems to be a misunderstanding here - i didn't choose the name WSRmac (windwos speech recognition) - microsoft did. it already exists and it's not a mediaportal plugin. it is just an extension for the already available speech rec. in vista and win7. you can download it for free and use it already.

    Thats because this should become a How To (use the windows speech rec) to cotrol Mediaportal. I am nowhere near beeing able to code a plugin for MP (-; i'm just trying to build macros to do so. it is very easy and everone can do it... just check the references above.

    Regarding your other question. it is possible to use some Masterphrase for the Macros - but sadly it does only effect these. you can define the triggery like you want to though, "computer, Stop" would be no problem (see the code examples on the top)

    The global keywords for the speech recognition are working anyways and there seems to be no way to resctrict voice control usage to macros only.

    I don't really have that problem though, since my microphone has a quick on/off switch i use to avoid uinwanted actions.

    The Speechrec. itself can be hibernated though, it then only listens to "start listening" or something like that.
     
  9. vecnar

    vecnar Portal Pro

    Joined:
    April 21, 2008
    Messages:
    129
    Likes Received:
    10
    Ratings:
    +10 / 0
    Home Country:
    Ireland Ireland
    Hi again,

    I did a quick test today and went through existing macros in download section Windows Speech Recognition Macros - Release: Samples and found windows media player controll macro which i think you want to achieve with mp. This worked well with mediaplayer like "play artist nirvana"
    My main concern is that windows speech recognition is for whole OS rather then specific application, you can't enable speech recognition for one app, at least that is what i understood reading wsrmacros forum.
    Another thing is that you can't change phrase "start listening" to anything else, you can change "stop listening" with another phrase though. I tried setting an alias to different phrase but it wouldn't work for start listening.
    Keep up a good work!
     
  10. smnnekho
    • Team MediaPortal

    smnnekho Retired Team Member

    Joined:
    February 6, 2006
    Messages:
    507
    Likes Received:
    7
    Location:
    Germany
    Ratings:
    +7 / 0
    I am currently in contact with a very helpful microsoft employee to sort that out. He already tipped me with an solution on how to stop a speakmacro from processing. .. so i can just say "stop" when i heard enough headlines.

    My idea would be to pack ALL commands wsr recognizes in one macro, assigning to no action and giving it a very high priority. That way it would only listen to the macros and if you want only with a master command... i'll keep you posted.
     
  11. vecnar

    vecnar Portal Pro

    Joined:
    April 21, 2008
    Messages:
    129
    Likes Received:
    10
    Ratings:
    +10 / 0
    Home Country:
    Ireland Ireland
    That sounds promising.
    I will get back to testing in a few weeks as i am packing my pc and tv today.
     
Loading...

Users Viewing Thread (Users: 0, Guests: 0)

  1. This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
    By continuing to use this site, you are consenting to our use of cookies.
    Dismiss Notice
  • About The Project

    The vision of the MediaPortal project is to create a free open source media centre application, which supports all advanced media centre functions, and is accessible to all Windows users.

    In reaching this goal we are working every day to make sure our software is one of the best.

             

  • Support MediaPortal!

    The team works very hard to make sure the community is running the best HTPC-software. We give away MediaPortal for free but hosting and software is not for us.

    Care to support our work with a few bucks? We'd really appreciate it!