Welcome, Guest
Username: Password: Remember me

TOPIC: Remote and Media Browser

Re: Remote and Media Browser 5 years 7 months ago #586

  • ben
  • ben's Avatar
Oh man! That is awesome! I have a whole bunch of ideas for using the weather script.

I have to work on vb scripting...
The administrator has disabled public write access.

Re: Remote and Media Browser 5 years 7 months ago #594

  • ben
  • ben's Avatar
hey eddy

Just to put my key trouble with my remote on hold for a moment. I was wondering if perhaps I could ask a question about calling two actions in the action line.

The reason is that Media Browser has a weather page that look pretty good. I was wondering If it's possible, while using your weather vb script to call up the Media Browser Weather page as well.

Right now if I sendkeys "{up}{up}{up} " in Media browser I can call the weather page. How would I use the sendkeys action and the callback action in the same line?

Thanks again.
Ben
The administrator has disabled public write access.

Re: Remote and Media Browser 5 years 7 months ago #595

  • eddy
  • eddy's Avatar
  • OFFLINE
  • Administrator
  • Posts: 191
  • Thank you received: 2
  • Karma: 5
The reason is that Media Browser has a weather page that look pretty good. I was wondering If it's possible, while using your weather vb script to call up the Media Browser Weather page as well.
You should be able to do this okay. I can think of two possible solutions.

The first is a two-step approach. Define a new custom command that just does the SendKey stuff. You can call it anything you like, since it's essentially going to be a voice subroutine invoked by the VBScript rather than an explicit voice command you'll say. Let's call it "Go To Media Browser Weather Page".

Now modify the Visual Basic Script so that after doing the weather stuff and fetching the current weather (or before, if you prefer), it invokes Amulet.Scanner with the /CMD option to run the sendkeys subcommand we defined previously.

For example, using the existing weather.vbs script as an example, you'd add two lines to the bottom like this:
Cmdline = chr(34) & "C:\Program Files\Amulet Devices\Amulet.Scanner.exe" & chr(34) & " /cmd " & chr(34) & "Go To Media Browser Weather Page" & chr(34)
WshShell.Run(Cmdline)

As before, all the chr(34) references represent double-quotes -- I find it's easiest to do it this way to make it explicit what we're doing when quoting command line arguments or program paths.

You can run Amulet.Scanner.exe /cmd "any voice command" to get Amulet to execute that voice command just as if you had spoken it directly, which is useful for all kinds of things but especially if you need to chain multiple commands together from VBScript.

If you're issuing more than one Amulet command at a time, you'll probably want to include a delay between each command; if Amulet is busy doing something and two new commands are issued close together, Amulet will only pay attention to the more recent one. To pause VBScript for two seconds, say WshShell.Sleep 2000 (presuming you have previously set WshShell = wscript.CreateObject("wscript.shell") of course.)

So, that's one way of doing it. The other way is to use VBScript to generate the Sendkeys directly, rather than doing it via Amulet. I won't get into that here but there are lots of examples on the web showing how to do it.

Hope this helps!

Eddy
The administrator has disabled public write access.

Re: Remote and Media Browser 5 years 7 months ago #598

  • ben
  • ben's Avatar
Yes thank you, Create the script and call it from the action line. I will start doing that. I have read a bunch about VBS and I can understand much better now.

Check this out:


Here is a vbs script that will read The MPAA Description and The Plot overview from the Movies.xml that Media Browser uses:


=======================================================================================
Dim Response, Talker


Dim xmlDoc, objNodeList, Description, MPAADescription

Set xmlDoc = CreateObject("Msxml2.DOMDocument")
xmlDoc.load("E:\Movies\Avatar\movie.xml")

Set objNodeList = xmlDoc.getElementsByTagName("MPAADescription")

If objNodeList.length > 0 then
For each x in objNodeList

MPAADescription=x.Text
Next

End If

Set objNodeList = xmlDoc.getElementsByTagName("Description")


If objNodeList.length > 0 then
For each x in objNodeList
Description=x.Text
Next

End If

Talker = "C:\Program Files\Amulet Devices\Amulet.Talker.exe"

Response = " " & MPAADescription & " . "& Description & " "

Dim Cmdline
Dim WshShell
set WshShell = wscript.CreateObject("wscript.shell")
' Need to put quotes around the Talker executable name, since the command line has spaces
Cmdline = chr(34) & Talker & chr(34) & " " & Response
WshShell.Run(Cmdline)
========================================================================================

It's messy as hell and there is no explanation lines, but I think you can see what it does.

The thing that would make this better, would be to get the name of the movie you just serached from the first line of the "SpeechCommandFile.Txt" in the programdata folder. It would then have to fill in the blanks as far as where the movie is located.

If I asked for "Avatar"

The SpeechCommand.Txt files first line is Avatar. That would have to fill in the blanks like this:
"E;\Movies\avatar\movie.xml"

Here is a problem. If my command to runn the script is "Overview". Then After I say the command, the SpeechCommand.Txt nolonger has avatar in it, it now has overview.

should be fun making it work. This is the easiest way to call different aspects of Media Browser through the movie.xml.

Thanks again for your Blog Tutorial on VBS and Amulet, definately made me think.

(The date.vbs is really bad, kinda funny...)
The administrator has disabled public write access.

Re: Remote and Media Browser 5 years 7 months ago #601

  • eddy
  • eddy's Avatar
  • OFFLINE
  • Administrator
  • Posts: 191
  • Thank you received: 2
  • Karma: 5
Okay, great example Ben! You're really starting to discover the possibilities now.

Re capturing the movie name, one possible approach might be to use VBScript for the initial command that recognizes the movie name, and have that VBScript capture the movie name to a permanent file (CurrentMovie.txt, say) that can then be used by your Overview command later on.

It's all starting to get a bit convoluted at this point, though still doable. I'll think about ways we can make this sort of thing easier for future revisions.

Eddy
The administrator has disabled public write access.

Re: Remote and Media Browser 5 years 7 months ago #602

  • ben
  • ben's Avatar
Hey!
Pretty excited here!
So far My script can:

Copy the The SpeechCommandFile text file that Amulet makes to a file called CurrentMovie.txt. This is nessesary to keep the last movie command. The beautiful thing about this copy paste of text is that By the Time I use the "Description" Command, the script has already be run by the "Search Movie Name" command" and therefore it can"t copy the last command in the new text document. Leaving only the Movie name listed in the text file.

Then My script Parses (nice lingo!) my movie drives. If there is an XML in the folder (which there is) then it will list the movie name one by one in a msgbox.

Here is the hard part that I'm working on.

1. Instead of a msgbox, my script need to compare the SpeechCommandFile with the output of the movie drive names when it searches them.
If there is a match then the script needs to go into the folder, open the XML and read the description/MPAA.

Also because I'm using up the Action line in the custom command to access this script, I also need to input the search for the movie. I think that this is able to happen by writting a different Script to access from this one.

It's becoming pretty indepth, but I am fairly confident that the out come will be worth while.

But (and I realize that there are more pressing matter to tend...)
If I reopen the CurrentMovie.txt for reading, to get the last movie name, is it possible to have VBScript read the name

Example:

Avatar

And compare it to the drives that are being search and then stop when it finds a match?

I'm sure it's some sort of "IF" statement....

Here is the parsing code I'm using if it helps:

Set oFSO = CreateObject("Scripting.FileSystemObject")
sFolder = "G:\Movies"
Set oParent = oFSO.GetFolder(sFolder)
For Each oXML In oParent.SubFolders
WScript.Echo oXML.Name
Next


There was a little cut and paste here, I realize that it's also looking at subfolders, there isn't any...
The administrator has disabled public write access.

Re: Remote and Media Browser 5 years 6 months ago #604

  • ben
  • ben's Avatar
Hello,

After a couple days of reading (it was alot) and some help from a couple really great guys over at MB COmunity Tracker I believe that finally a parsing app for Description and MPAARating from the Media browser Movie.XML is almost finished.

After some discussion and testing using VBS, we found that it was kind of slow to search the movie data base for the movie folder, so we decided to try and use vb.net to write the program. That was where I was lost. I can understand VBS, but not .NET. However the final product will read the SPeechCommandFile.txt and use the last movie search to parse and read the XML.

It accually is harder than it sounds and VBS was really slow when I finally got the whole thing working.

Definately a learn curve and useful for other avid Amulet/MediaBrowser users out there!

Will post the final app soon.
The administrator has disabled public write access.

Re: Remote and Media Browser 5 years 6 months ago #605

  • ben
  • ben's Avatar
Just a quick update,

We've decided to use a client based execuable to read the SpeechCOmmandFile.txt. It's extremely fast! It's called VOice Watcher.

You're able to add the folders that your movies/TV Series are stored in. Then it recusivly scans your movie folders and matches the COmmandFile Text document, in a matter on milliseconds.

Really cool stuff.

The next part will be using the Talker to read the xml inside the matched folder.

The whole thing should be read for release this week.

The only thing is, you still have to write all the customCommands for your movies. But with the help of the updated VCP program, that's a piece of cake!

VCP will create Custom Commands that are easily made for Media Browser.
Put the right amount of milliseonds pauses between the search letters and finish with the spacebar keystoke needed, and export them to a text file.

Then it's just cut a paste.
The administrator has disabled public write access.

Re: Remote and Media Browser 5 years 6 months ago #612

  • eddy
  • eddy's Avatar
  • OFFLINE
  • Administrator
  • Posts: 191
  • Thank you received: 2
  • Karma: 5
We've decided to use a client based execuable to read the SpeechCOmmandFile.txt. It's extremely fast! It's called VOice Watcher
...
VCP will create Custom Commands that are easily made for Media Browser.
Put the right amount of milliseonds pauses between the search letters and finish with the spacebar keystoke needed, and export them to a text file. Then it's just cut a paste.
This is turning into a really useful solution; great work, Ben!

If I could make a suggestion, why not go the last mile and add a custom command that will automate the whole thing: maybe Update Media Browser for example, that launches a batch file or VBScript that:

- Runs VCP to re-index everything
- Concatenates your "standard" custom command file and the VCP output into a new file
- Runs "AmuletScanner /CUSTOM" to force the custom commands to be reloaded

This would allow you to easily update your Media Browser index with a simple voice command whenever you want, without having to do any manual work, or indeed even exit Media Center!

Eddy
The administrator has disabled public write access.

Re: Remote and Media Browser 5 years 5 months ago #639

  • ben
  • ben's Avatar
Tobias and I relased a version of Voice Watch, which in my opinion, is pretty awesome.
It will read descriptions of movies from with in media browser using my idea of monitoring the VoiceCommandFile,described before. It will monitor your TV Series Folders for new media and then use the talker to tell you of new shows that are available to watch. You can edit how the talker reads the metadata from the movie.xml, and best of all you can tell the watcher what your favorite TV Shows are and then it will search an rss feed online and tell you if your shows are on that night or the next.

It also has an auto updating feature, so when new releases are made you can update easily.

useful??...I think so.
The administrator has disabled public write access.

Re: Remote and Media Browser 5 years 5 months ago #640

This is in response to Ben's post right above.

Here is a quick start guide: View

Here is the program: Download

The next thing to be added to the tool is the ability to get new movies announced, like the tv shows do now.

thanks,
tobias.
Last Edit: 5 years 5 months ago by tobiastobin.
The administrator has disabled public write access.

Re: Remote and Media Browser 5 years 5 months ago #641

I updated the tool. Instead of watching for new tv shows it now watches for new 'content'. It will automatically discern tv shows and movies. You can then get new tv shows or new movies by separate voice commands.

Let me know if there are any issues.

Thanks,
tobias.
The administrator has disabled public write access.

Re: Remote and Media Browser 5 years 5 months ago #646

Hi,
Has anyone tried this tool? I'm looking for any feedback you might have. Also, is there something that could be added to the tool that would make you want to use it?

Thanks,
tobias.
The administrator has disabled public write access.

Re: Remote and Media Browser 5 years 5 months ago #650

Update 6 is out. This update, in my opinion, has made the tool *much* better. The problem was this - when you say a movie name, my tool tries to figure out if what you said is a movie you have. If it can find it then it becomes the 'active' movie and all of the voice commands that return information about a movie can be used. But the problem was, like for me, even though I have MetaBrowser set to name my folders for me using %lt I get names like:
'The Thing III (1971)'. Well you probably don't know that is what your folder is named. And the tool's designed to determine if you have a movie by matching the phrase from Amulet to a folder name. Well you are not going to know to say 'The Thing III (1971)' and in addition, what Amulet records as you saying may not match the characters in the name. So to try and remedy this I made a bridge between 'spoken movie name' and 'folder name'. It is more like a search.

Here is how it works. Let's say you say to Amulet 'The Thing 3'. Amulet recognizes 'The Thing Three'. We know that is not going to match 'The Thing III (1971)'. You will see in the output window that you did not get a match. So you know it didn't work. So instead, say this 'The Thing'. Now, I take what you said and drop anything 3 characters or less. That will take out ' - ' or 'The' or 'And' or '&', etc. And we are left with 'words'. Next, I try to match the word or words in what you said to a folder. I then present the results to you as a selection list. I need you to confirm for me what movie it is that you really want, so I can make the 'bridge'. So let's say in your movie collection you have 'The Thing' and 'The Thing III (1971)'. You say 'The Thing'. 2 Matches are found using the search term 'Thing'. The talker will then say 'Please select from the choices by saying the letter'. Then you will hear 'a . The Thing', 'b . The Thing III (1971). You wanted the second one so you say 'b'. The tool will then 'load' the movie The Thing III (1971). You can then execute all of your movie related query speech commands.

It is kind of like wildcarding in a sense. But you can trigger misses by being too specific. Let's say you say 'Mission Impossible Blah'. And you have three movies with Mission Impossible in the folder name, but none with Blah. So you will not get a match, nor will you be presented with a choose from list. That's because I structured it so that the only results you will get back are when all 'words' match 'words' in the folder name. So Blah will keep us from finding any Mission Impossible movies. So instead you should say 'Mission Impossible' and you will get back the choices for all three of your Mission Impossible movies.

Let me make another example. I have Mission Impossible Ghost Protocol movie. But the folder is named 'Mission Impossible - Ghost Protocol'. If I say 'Mission Impossible Ghost Protocol' a match will be made to the folder 'Mission Impossible - Ghost Protocol' but because I am 'bridging' the speech to a folder name, I have to present you with the choice. So you may be like 'why is it asking me if I want a . Mission Impossible - Ghost Protocol when I just said that. Well it is because it was not a direct match do to the ' - ' in the folder name, so I have to ask you if this is what you want. Then the bridge is created to the folder and you can get your info.

Oh, and you can have fun with it. Maybe you don't know what you want to watch so you just say something like 'Rise'. You get back choices like 'Tequilla Sunrise' and 'Underworld Rise of the Lycans'.

In case you need it, here is the Installer.

Thanks,
tobias.
Last Edit: 5 years 5 months ago by tobiastobin.
The administrator has disabled public write access.

Re: Remote and Media Browser 5 years 5 months ago #653

  • eddy
  • eddy's Avatar
  • OFFLINE
  • Administrator
  • Posts: 191
  • Thank you received: 2
  • Karma: 5
Tobias,

I just wanted to say how cool this is - really nice job, and a great example of how far you can push a feature beyond what it was originally intended for :-)

I hope we can include some extra custom command features in the next release that will make your life a bit easier; let me know if there are specific things that would help you out.

Regards,

Eddy
The administrator has disabled public write access.

Re: Remote and Media Browser 5 years 5 months ago #657

  • ben
  • ben's Avatar
Some usefull keystrokes...


Refresh (Sendkeys "{ctrl-R}")

TV Series Commands

Next Episode (Sendkeys "{ctrl-F}")
Previous Episode (Sendkeys "{ctrl-B}")

These seem to be the most important when using Media Browser with AMulet.

I think that between the Voice watcher, custom commands list and these simple keystrokes, Media Browser is fully functional, and more...

There is about a 10% miss rate when calling movies from the library in MB with the custom commands listed in this thread, and it only happens when you call a movie too quickly while MB is hogging the cpu on start up. Sounds like a lot, but I tested about 1 in 10 times at start up, the wrong movie was choosen, after that each movie is choosen properly in MB.


Nice!
The administrator has disabled public write access.

Re: Remote and Media Browser 5 years 5 months ago #658

Hi eddy,
Thank you very much. I'm happy to hear you are cool with it. If you would like for me to test anything let me know. Probably what would help me is a small tutorial on how amulet works. All I'm doing is filesystemwatching the speechcommand.txt file for changes. On change then doing onchanged event processing. Is that the best way to do this?

If you have any interesting documentation on how your software works I'd be interested in checking it out. Both to maybe make this add-on better, and also just because it is fun to learn about how people do things.

Thanks again eddy,
tobias.
The administrator has disabled public write access.

Re: Remote and Media Browser 5 years 5 months ago #659

For those who are interested, there have been a flurry of updates to the application. I should post an overview of what changed.

On the settings tab, you can now specify the path to your Amulet customcommands text file. If you use any custom commands you should use this feature and set the path. The purpose of this is voice watcher will automatically ignore any commands in your custom commands. That way voice watcher does not cause issues with those. If you have commands in there and want to see what exactly is being ignored, there is a button on the output tab (the first tab) that let's you see them listed out.

Next, the tool now writes an error.txt file each time it is opened. In that I write stuff that is going on and any errors that occur. If a problem happens, you can send me the file and it will help me diagnose.

Finally, the new 'Speech Output Substitutions' tab. With this you can change the spoken output from Amulet by replacing one value with another. A good example, in the first box you put II and in the new text box you put space , space Two. In other words ' , two'. Now when the II is spoken you will here 'Two'. This only effects stuff voicewatcher triggers, it will not effect other output from Amulet Talker.

*Note - the substitutions is not really done. So consider it in testing mode. If you get incorrect results I am aware of it :)
The administrator has disabled public write access.

Re: Remote and Media Browser 5 years 5 months ago #660

eddy,
Thus far I have done all of this without owning an Amulet remote. I just ordered one though.

Ben and I got to do some testing tonight and I discovered that not all speech gets written to the speechcommand.txt file? Only recognized commands. Is this correct? If so, then using my application without the proper modifications to the customcommands.txt file makes my application not work. Grizzly discover it seems.

Ben has spent days customizing this file for making everything work. I had no idea that was required for speech commands to be 'written'. I would have though if I had an Amulet at the time :)

So my attempt to create an exclusion file is not right, and for the average person to use this tool, extensive modification to the customcommands.txt file will have to be implemented by the voicewatcher app. I suspect appending commands to the file based on this or that.

Wow, what a change. This all hinges on the fact that according to testing with Ben, the speechcommand.txt file is not written to unless the command is 'defined'.

Is there another way I can catch all input from the Amulet device? Another way other than watching for changes to that file?

You don't have an API I could use do you?

Will you email me at This e-mail address is being protected from spambots. You need JavaScript enabled to view it ? I have a question to ask you.

Thanks,
tobias.
The administrator has disabled public write access.

Re: Remote and Media Browser 5 years 5 months ago #661

oops duplicate post.
Last Edit: 5 years 5 months ago by tobiastobin.
The administrator has disabled public write access.
Time to create page: 0.298 seconds
Powered by Kunena Forum