[How To] Control Mediaportal with your voice using WSRmac (1 Viewer)

smnnekho

Retired Team Member
  • Premium Supporter
  • February 6, 2006
    507
    7
    40
    Germany
    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.
     

    smnnekho

    Retired Team Member
  • Premium Supporter
  • February 6, 2006
    507
    7
    40
    Germany
    Examples:

    This a Syntax example how to pause the current playback:

    Code:
    <?xml version="1.0" encoding="UTF-16"?>
    <speechMacros>
    
      <command>
        <listenFor>Pause</listenFor>
        <listenFor>Hold ?Playback</listenFor>
        <listenFor>Resume ?Playback</listenFor>
        <listenFor>Play</listenFor>
        <listenFor>I need to pee</listenFor>
        <listenFor>?I Returnd from peeing</listenFor>
        <sendKeys>{u+0020}</sendKeys>
      </command>
    
    </speechMacros>

    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:
    <?xml version="1.0" encoding="UTF-16"?>
    <speechMacros>
         <command>
              <listenFor>?Computer, ?Why ?don't ?you say Hi to [...]</listenFor>
              <speak>Hi {[...]}. I'm smnnekho's computer</speak>
         </command>
    
    </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:
    <?xml version="1.0" encoding="UTF-16"?>
    <speechMacros>
    
    <command>
    <listenFor>Was ist los in der Welt?</listenFor>
    <listenFor>Schlagzeilen von Welt Online</listenFor>
    
    <speak>Aquiring Data...</speak>
    
    <script language="JScript">
    <![CDATA[
    var xml_doc = new ActiveXObject("Microsoft.XMLDOM");
    xml_doc.async = false;
    xml_doc.load("http://www.welt.de/?service=Rss");
    var titles = xml_doc.getElementsByTagName("title");
    var descriptions = xml_doc.getElementsByTagName("description");
    
    Application.Speak(titles.item(2).text);
    Application.Speak(descriptions.item(2).text);
    
    Application.Speak(titles.item(3).text);
    Application.Speak(descriptions.item(3).text);
    
    Application.Speak(titles.item(4).text);
    Application.Speak(descriptions.item(4).text);
    
    Application.Speak(titles.item(5).text);
    Application.Speak(descriptions.item(5).text);
    ]]>
    </script>
    </command>
    </speechMacros>

    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...
     

    smnnekho

    Retired Team Member
  • Premium Supporter
  • February 6, 2006
    507
    7
    40
    Germany
    Some other MP-controlling examples (not yet translated)

    Code:
      <command>
        <listenFor>Auswählen</listenFor>
        <listenFor>Enter</listenFor>
        <sendKeys>{ENTER}</sendKeys>
      </command>
    
    
      <command>
        <listenFor>Zurück</listenFor>
        <sendKeys>{ESC}</sendKeys>
      </command>
    
      <command>
        <listenFor>Vollbild</listenFor>
        <sendKeys>x</sendKeys>
      </command>
    
      <command>
        <listenFor>?aktuelles ?programm aufnehmen</listenFor>
        <listenFor>?aktuelle ?Sendung aufnehmen</listenFor>
        <sendKeys>r</sendKeys>
      </command>
    
      <command>
        <listenFor>Play</listenFor>
        <listenFor>abspielen</listenFor>
        <sendKeys>p</sendKeys>
      </command>
    
      <command>
        <listenFor>STOP</listenFor>
        <listenFor>Abspielen beenden</listenFor>
        <sendKeys>b</sendKeys>
      </command>
    
      <command>
        <listenFor>?Zeige Informationen</listenFor>
        <sendKeys>{F3}</sendKeys>
      </command>
     

    vecnar

    Portal Pro
    April 21, 2008
    129
    10
    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.
     

    msj33

    MP Donator
  • Premium Supporter
  • November 30, 2005
    471
    76
    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:)
     

    smnnekho

    Retired Team Member
  • Premium Supporter
  • February 6, 2006
    507
    7
    40
    Germany
    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:)

    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.
     

    vecnar

    Portal Pro
    April 21, 2008
    129
    10
    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!
     

    smnnekho

    Retired Team Member
  • Premium Supporter
  • February 6, 2006
    507
    7
    40
    Germany
    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!

    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.
     

    vecnar

    Portal Pro
    April 21, 2008
    129
    10
    Home Country
    Ireland Ireland
    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.
    That sounds promising.
    I will get back to testing in a few weeks as i am packing my pc and tv today.
     

    Users who are viewing this thread

    Top Bottom