New Plugin - Speech Recognition (1 Viewer)

Si Jones

Portal Member
October 4, 2012
8
1
45
Home Country
United Kingdom United Kingdom
Hi All,

Am developing my own speech recognition app with a plugin for MP - am not writing the actual engine just using the .net version that's included in Windows.

I have written a test app and it works pretty well without any training.

My theory is - a service / app that will run all the time listening for commands, this will allow for it to start media portal / restart pc and do all the pc type commands, the second is then a plugin within mediaportal that will connect to the app and when a command is meant for mediaportal it will be passed to the plugin to execute.

A second part is to allow the app to run on multiple pc's, so in my case the app will run on the tv pc and my laptop so with my laptop being on my lap mostly it will hear the commands and pass them to the app on the tv pc to do, i think this will work quite well - hopefully!

Now i've explained that, here's my issue, i've not found what am looking for within the help developing doc's, i have read the basic how to on plugins, but am not clear with interface to include, i currently have the isetupform and iplugin included, but am not sure what to do for the compatibility code?

Am doing this in vb.net 4, VS2013, am ok in vb and can read c# but not familiar enough to write in c#, the bit's am wanting to know is what imports (using) are required to send commands in to MP, and what to do to read the status of MP, as if am already playing tv i want to ignore a command to play tv, or show tv guide etc etc...

Anyone point me in the right direction? i've looked at the current plugins i could see in the mp code base and don't see any attributes used for the compatibility code etc...

Sorry to be a pain!
 

KDW001

New Member
December 18, 2013
1
0
Home Country
Belgium Belgium
Hi, since I'm working on a similar project, I was just wondering, did you find a solution yet to send commands (for example switch channel) to the MP and get feedback about its state?

I probably cannot point you in the right direction but my guess is that you need to create a plugin that behaves like a remote control (check the folder MediaPortal-1-Release_1.5.0\mediaportal\RemotePlugins\Remotes in the source code). Instead of listening to an IR command, you create a plugin that listens at a TCP/IP socket for commands you have specified in your own kind of "command communication protocol". If you want bi-directional communication, this also can be done easily using socket communication. Probably this is far from the best possible solution, but I can't come up with better ideas at this moment. I haven't written any relevant code for the MP so far, so I cannot help you with any example code yet.

Please feel free to share your toughts about the mentionned solution...
 

Si Jones

Portal Member
October 4, 2012
8
1
45
Home Country
United Kingdom United Kingdom
Hi,

I haven't progressed this as I couldn't see how to communicate internally with MediaPortal for the status etc, this is the bit that I need to know what DLL's and interfaces can give me information.

The speech recognition and sockets comms are not a problem, I can write all that code, it's the media portal side but I don't think there is anyone wanting it so it can just die off.

Regards,

Simon
 

exe222

Portal Pro
August 22, 2011
71
18
Home Country
Germany Germany
Hi,
but I don't think there is anyone wanting it so it can just die off.

Hey Simon,
the idea sounds great. I just can't help as I am facing the same problems. Hardly no documentation and a lot "learning by doing"... :(
I am just wondering if it may be better to wait for a "cortana" windows 8/9 update and see what it supports out of the box?

I guess that it will support commands like

"watch tv"
"start mediacenter"
"stop playback"

out of the box similar to what is already available @XBox one. We'll see.

Regards,
exe222
 

Quarter

MP Donator
  • Premium Supporter
  • June 21, 2010
    722
    138
    Queenstown
    Home Country
    New Zealand New Zealand
    I not sure what you are really after, but you can override on action commands and receive windows messages, my thinking this is all you would need? Not 100% tho
     

    Quarter

    MP Donator
  • Premium Supporter
  • June 21, 2010
    722
    138
    Queenstown
    Home Country
    New Zealand New Zealand
    in C#

    Code:
    using MediaPortal.GUI.Library;
    using Action = MediaPortal.GUI.Library.Action;
    
    public override bool OnMessage(GUIMessage message)
        {
          switch (message.Message)
          {
            case GUIMessage.MessageType.GUI_MSG_ITEM_SELECTED:
              {
              }
              break;
          }
          return base.OnMessage(message);
        }
    
    public override void OnAction(Action action)
        {
          switch (action.wID)
           {
             case Action.ActionType.ACTION_STOP:
               {
               }
               break;
            }
            return base.OnAction(action);
          }

    AssemblyInfo.cs
    Code:
    using MediaPortal.Common.Utils;
    
    [assembly: CompatibleVersion("1.6.100.0", "1.6.100.0")]
    [assembly: UsesSubsystem("MP.SkinEngine")]
    [assembly: UsesSubsystem("MP.Config")]
     

    Users who are viewing this thread

    Top Bottom