Jojo, dem Sprengmeister neulich auch "molkemon" (komm und trink sie leer) genannt war mal wieder ULTRA LANGWEILIG was mich dazu veranlasst hat, mal ein bisschen mit der Windows Sprachsteuerung rumzuspielen.
Out of the box ist das Teil relativ nutzlos. Aber Microsoft hat da so ein nettes Tool veröffentlicht, names Windows Speech Recognition Macros. Es ist mächtig. Sehr mächtig. Download hier: Download details: Windows Speech Recognition Macros
Damit kann man eigene Macros in XML schreiben um komplexe Operationen durchzuführen. Die Microsoft Devs haben auch ein paar Beispielmacros veröffentlicht, darunter ein extrem cooles Kontrollmacro für den Windows Media Player. Man kann ihn damit ausgezeichnet steuern. In der Orginalversion hatte es allerdings einige schwerwiegende Bugs welche ich ausgebügelt habe. Sehr empfehlenswert wenn man gerade Counterstrike oder irgendwas anderes zockt und keinen Bock hat rauszutabben. Oder wenn man keine Hände hat... usw.
Der kleine Haken dabei, mit der deutschen Windows Version funktioniert es nicht zu wirklich, da diese Probleme hat, Englisch zu verstehen. Deshalb müsst ihr entweder bereits englisches Windows besitzen, oder eure Vista/7 Version auf Englisch umstellen. Dies könnt ihr mit diesem Tool machen: Vistalizator - change display language in Windows Vista and Windows 7
Dazu müsst ihr erst das Tool runterladen, sowie die englische Sprachdatei (ebenfalls auf der Seite, das ist eine ca 120mb große EXE file, die EXE führt ihr aber nicht aus sondern läd sie mit Vistalizator. ca 20 Minuten und einen Neustart später ist euer Windows komplett in Englisch. Natürlich könnt ihr es mit der deutschen Sprachdatei rückgängig machen.
Ich habe bereits für das msdn diverse Anleitungen geschrieben, und ich bin jetzt zu faul das alles auf Deutsch zu übersetzen. Daher mache ich jetzt billigen copypaste meiner englischen Texte. Viel Spaß
Anschließend findet ihr
1) Das WMP WSR Macro
2) Eine Push to Talk Funktion für die Windows Speech Recogntion
3) Eine Sprachgesteuerte Lautstärkenregelung
Das WMP WSR Macro
Hello!
A few years ago Rob Chambers from Microsoft posted a Macro on his blog that lets you fully control Windows Media Player. It's working really really well and its quite the show-off at parties, but his original version had quite a few bugs and half the commands he provided worked not exactly as intended. After some fiddling around, I proudly present a new and quite vastly improved version of this. I would recommend you use either the Push to Talk function (see http://www.msspeech-forum.com/forum_posts.asp?TID=238 ) or headphones if you want to leave the microphone open, because playing music with the mic on will produce unpredictable input to the speech recognition
Some (but not all) of the commands you can use (check the macro code for all possible things you can say):
Pause Music
Play Music
Play Artist/Band *artist*
Play Track/Song *track*
Play Album/CD *album*
Play Genre *genre*
Play the Artist that sang *track*
Play the Album that has *track* on it
Next Track
Previous Track
Skip ahead/back 1-20 tracks
Shuffle on/off
Repeat is bugged sadly, you can turn it off when its enabled with repeat off, but you can't turn it on by voice
Note that of course you can only call for artists/songs that are actually in your Windows Media Player Library. Also note that some things like Genre etc. only work if your files are tagged properly. Windows Media Player has an in-built function that can download and apply missing tags automatically. There is also a great tagging tool called Picard. You can get it at Welcome to MusicBrainz! - MusicBrainz
For the ones of you who already know the macro, here is a quick "changelog":
I would like to express thanks to a lot of beer and Puffy, my trusty water pipe that got me over lots of frustration in making all this work
IMPORTANT: If Windows Media Player crashes when you start it up with activated Speech Recognition, remove all the "Rating" columns by right-clicking on the columns and select "Choose Columns". That fixed the problem for me.
Finally, here is the macro:
Push to Talk Funktion für Windows Speech Recognition
I wasn't exactly sure where to post this, but I guess I'll just leave it here for now.
--
So, I figured that most of you probably don't know about this yet, so for your information:
The Basic Windows Speech Recognition has a hotkey that will toggle the microphone between sleeping and listening. This combination is
Ctrl + Windows Key
So far, so good. If you have the Windows Speech Recognition Macros running, this behaviour gets modified. It now switches between off and listening. Also, and more importantly, if you press the combination for more than 500ms, it will exhibit a "push to talk" function, as in it will listen as long as you are pressing the buttons down and then go back to offline. So far, so awesome. Now Ctrl + Win isn't the best possible hotkey so I was looking for a way to modify it, and I eventually came up with something.
First, you need to download and install AutoHotkey: AutoHotkey Download
This is a very powerful tool that will let you create complex macros for various hotkeys (e.g. insert a whole lot of text by pressing some key combination), and will also let you substitute keys on your keyboard with each other (e.g. if you press b, it will type a if you want to).
There is a comprehensive help file that comes along with the tool if you wanna know more about it, but for our purposes, here is the script that will function as our push to talk button:
~Xbutton2::
Send {LCtrl down}+{Lwin down}
KeyWait, Xbutton2
Send {LCtrl up}+{Lwin up}
return
Replace both Xbutton2 instances with the key you actually want to use (check the Auto Hotkey helpfile for a list of all possible keys).
That's it, thats all that it takes. Xbutton2 is the 5th mouse button if you happen to have such a thing, but basically you can use any key instead of Xbutton2 (eg. you could use Insert or Home, or Tab. IMPORTANT: Unless you put that tilde ( ~ ) in front of the Key you want to assign, it will not retain it's original functionality. WITH the ~, it will do BOTH: act as the push to talk button AND the keys original purpose. It's up to you if you want that or not of course. If you remove the tilde, the original function of the key will be disabled as long as the AutoHotkey script is running. ).
This script emulates the exact behaviour of the Ctrl+Win combination: if you press the key/button only shortly, the microphone will toggle between listening/offline. If you hold down the key/button, it will listen as long as its pushed down and go back to offline as soon as you release it.
Best regards.
Lautstärkenregelung
Here is a simple Macro that will lower/increase the Windows System Volume.
First, you need to download and install this little tool: Sound Volume Hotkeys - Control sound volume using system-wide hotkeys.
It will run in the background and add the hotkeys ctrl up and ctrl down to modify the system volume.
We can now use a WSR Macro to do this for us.
You can say: volume up / louder or volume down / quiter
and also "silence i kill you" for mute and my personal favorite "turn it to eleven" for max volume
Best Regards
HULDIGT DEM MEISTER DER LANGEWEILE!
Out of the box ist das Teil relativ nutzlos. Aber Microsoft hat da so ein nettes Tool veröffentlicht, names Windows Speech Recognition Macros. Es ist mächtig. Sehr mächtig. Download hier: Download details: Windows Speech Recognition Macros
Damit kann man eigene Macros in XML schreiben um komplexe Operationen durchzuführen. Die Microsoft Devs haben auch ein paar Beispielmacros veröffentlicht, darunter ein extrem cooles Kontrollmacro für den Windows Media Player. Man kann ihn damit ausgezeichnet steuern. In der Orginalversion hatte es allerdings einige schwerwiegende Bugs welche ich ausgebügelt habe. Sehr empfehlenswert wenn man gerade Counterstrike oder irgendwas anderes zockt und keinen Bock hat rauszutabben. Oder wenn man keine Hände hat... usw.
Der kleine Haken dabei, mit der deutschen Windows Version funktioniert es nicht zu wirklich, da diese Probleme hat, Englisch zu verstehen. Deshalb müsst ihr entweder bereits englisches Windows besitzen, oder eure Vista/7 Version auf Englisch umstellen. Dies könnt ihr mit diesem Tool machen: Vistalizator - change display language in Windows Vista and Windows 7
Dazu müsst ihr erst das Tool runterladen, sowie die englische Sprachdatei (ebenfalls auf der Seite, das ist eine ca 120mb große EXE file, die EXE führt ihr aber nicht aus sondern läd sie mit Vistalizator. ca 20 Minuten und einen Neustart später ist euer Windows komplett in Englisch. Natürlich könnt ihr es mit der deutschen Sprachdatei rückgängig machen.
Ich habe bereits für das msdn diverse Anleitungen geschrieben, und ich bin jetzt zu faul das alles auf Deutsch zu übersetzen. Daher mache ich jetzt billigen copypaste meiner englischen Texte. Viel Spaß
Anschließend findet ihr
1) Das WMP WSR Macro
2) Eine Push to Talk Funktion für die Windows Speech Recogntion
3) Eine Sprachgesteuerte Lautstärkenregelung
Das WMP WSR Macro
Hello!
A few years ago Rob Chambers from Microsoft posted a Macro on his blog that lets you fully control Windows Media Player. It's working really really well and its quite the show-off at parties, but his original version had quite a few bugs and half the commands he provided worked not exactly as intended. After some fiddling around, I proudly present a new and quite vastly improved version of this. I would recommend you use either the Push to Talk function (see http://www.msspeech-forum.com/forum_posts.asp?TID=238 ) or headphones if you want to leave the microphone open, because playing music with the mic on will produce unpredictable input to the speech recognition
Some (but not all) of the commands you can use (check the macro code for all possible things you can say):
Pause Music
Play Music
Play Artist/Band *artist*
Play Track/Song *track*
Play Album/CD *album*
Play Genre *genre*
Play the Artist that sang *track*
Play the Album that has *track* on it
Next Track
Previous Track
Skip ahead/back 1-20 tracks
Shuffle on/off
Repeat is bugged sadly, you can turn it off when its enabled with repeat off, but you can't turn it on by voice
Note that of course you can only call for artists/songs that are actually in your Windows Media Player Library. Also note that some things like Genre etc. only work if your files are tagged properly. Windows Media Player has an in-built function that can download and apply missing tags automatically. There is also a great tagging tool called Picard. You can get it at Welcome to MusicBrainz! - MusicBrainz
For the ones of you who already know the macro, here is a quick "changelog":
- Calling for Artists/Albums/Tracks that contain certain special chars (most importantly an apostrophe ' ) does work now! However, to achieve this, I had to disable the useSubset modifier on certain rules. This means that you now ALWAYS have to call for the FULL Title/Name of what you want to hear (e.g. "play Artist Fray" used to work, but WON'T WORK NOW, instead you have to say "play Artist The Fray"). This minor limitation is still a lot better than not being able to call certain songs/artists at all.
- "skip ahead/back x tracks" wheras x is greater than 2 will no longer crash the Macro/WMP and will work properly now to a maximum of skipping 20 tracks.
- "play the album that has track on it" and "play the artist that sang track" work properly now (before it tended to play the track instead of the artist/album or exhibit some other randomness).
- Calling for a specific artist located on an album that has "Various Artists" as its AlbumArtist works now. e.g. If you have some mixtape CD's with an Elton John song on it, saying "play artist Elton John" will now correctly add those songs. IMPORTANT: Due to this change, saying "play Artist - Various Artists" will NO LONGER WORK.
- Shuffle works more sane now. Before, when you said just "shuffle" it would always turn shuffle off for some reason. It now correctly toggles shuffle on and off (you can say "toggle shuffle" or just "shuffle"). You can also say shuffle on or shuffle off.
- Repeat should work in the same manner, however, there seems to be a bug with the repeat executor in WSR. repeat on and toggle repeat doesn't seem to work. repeat off and toggle repeat works though if it is already enabled. There is nothing I can do about that. :/
- I've removed all the (disabled) functions for "play year" because a) it was disabled before anyway and only took up space, b) it's pretty pointless and c) it's hard to get correct year tags for many files.
I would like to express thanks to a lot of beer and Puffy, my trusty water pipe that got me over lots of frustration in making all this work
IMPORTANT: If Windows Media Player crashes when you start it up with activated Speech Recognition, remove all the "Rating" columns by right-clicking on the columns and select "Choose Columns". That fixed the problem for me.
Finally, here is the macro:
Code:
<?xml version="1.0" encoding="UTF-16"?>
<!-- Windows Media Player -->
<speechMacros>
<!--
Author: Rob Chambers MSFT
Contact: listen@microsoft.com
Some fixes by: molkemon
-->
<!-- Start Media Player -->
<command>
<listenFor>Media Player</listenFor>
<emulateRecognition>start Media Player</emulateRecognition>
</command>
<!-- Play Artist Command -->
<command>
<listenFor>play ?the artist [Artists]</listenFor>
<listenFor>play ?the band [Artists]</listenFor>
<listenFor>play ?the group [Artists]</listenFor>
<setTextFeedback>Playing Artist {[*Artist]}</setTextFeedback>
<wmpMediaControl command="pause"/>
<disambiguate title="Which artist do you want to play?" prompt="Choose an Artist" timeout="25" propname="Artist"/>
<setState name="playMediaTypeName" value="Artist"/>
<setState name="playMediaTypeValue" value="{[*Artist]}"/>
<setState name="playMediaAttrName" value="Author"/>
<setState name="playMediaAttrValue" value="{[Artist]}"/>
<emulateRecognition>Play what I asked for</emulateRecognition>
</command>
<!-- Play Album Command -->
<command>
<listenFor>play ?the album ?named [Albums]</listenFor>
<listenFor>play ?the C D ?named [Albums]</listenFor>
<listenFor>play ?the [Albums] C D</listenFor>
<listenFor>play ?the [Albums] album</listenFor>
<setTextFeedback>Playing Album {[*Album]}</setTextFeedback>
<wmpMediaControl command="pause"/>
<disambiguate title="Which album do you want to play?" prompt="Choose an Album" timeout="25" propname="Album"/>
<setState name="playMediaTypeName" value="Album"/>
<setState name="playMediaTypeValue" value="{[*Album]}"/>
<setState name="playMediaAttrName" value="WM/AlbumTitle"/>
<setState name="playMediaAttrValue" value="{[Album]}"/>
<emulateRecognition>Play what I asked for</emulateRecognition>
</command>
<!-- Play Genre Command -->
<command>
<listenFor>play ?the genre [Genres]</listenFor>
<setTextFeedback>Playing Genre {[*Genre]}</setTextFeedback>
<wmpMediaControl command="pause"/>
<disambiguate title="Which genre do you want to play?" prompt="Choose a Genre" timeout="25" propname="Genre"/>
<setState name="playMediaTypeName" value="Genre"/>
<setState name="playMediaTypeValue" value="{[*Genre]}"/>
<setState name="playMediaAttrName" value="WM/Genre"/>
<setState name="playMediaAttrValue" value="{[Genre]}"/>
<emulateRecognition>Play what I asked for</emulateRecognition>
</command>
<!-- Play Track Command -->
<command>
<listenFor>play ?the track ?named [TrackNames]</listenFor>
<setTextFeedback>Playing Track {[*SourceURL]}</setTextFeedback>
<wmpMediaControl command="pause"/>
<disambiguate title="Which track do you want to play?" prompt="Choose a Track" timeout="25" propname="SourceURL"/>
<setState name="playMediaTypeName" value="Track"/>
<setState name="playMediaTypeValue" value="{[*SourceURL]}"/>
<setState name="playMediaAttrName" value="SourceURL"/>
<setState name="playMediaAttrValue" value="{[SourceURL]}"/>
<emulateRecognition>Play what I asked for</emulateRecognition>
</command>
<!-- Play Anything Command -->
<command>
<listenFor>play [GenreArtistAlbumTrack]</listenFor>
<setTextFeedback>Playing {[*GenreArtistAlbumTrack]}</setTextFeedback>
<wmpMediaControl command="pause"/>
<script language="JScript" >
<![CDATA[
genreArtistAlbumTrack = "{[*GenreArtistAlbumTrack]}";
matchingGenres = CommandSet.RuleGenerators("Genres").Rule.Items.FindTextMatches(genreArtistAlbumTrack);
matchingArtists = CommandSet.RuleGenerators("Artists").Rule.Items.FindTextMatches(genreArtistAlbumTrack);
matchingAlbums = CommandSet.RuleGenerators("Albums").Rule.Items.FindTextMatches(genreArtistAlbumTrack);
matchingTracks = CommandSet.RuleGenerators("TrackNames").Rule.Items.FindTextMatches(genreArtistAlbumTrack)
addMediaItems("Genre:", matchingGenres, ChooseFromList.Items);
addMediaItems("Artist:", matchingArtists, ChooseFromList.Items);
addMediaItems("Album:", matchingAlbums, ChooseFromList.Items);
addMediaItems("Track:", matchingTracks, ChooseFromList.Items);
if (ChooseFromList.Items.Count == 0)
{
Command.Exit(1);
}
chosen = ChooseFromList.Items.Count == 1
? 0
: ChooseFromList.Choose("What did you want to play?", "Play media");
NamedStates.ClearNamedState("playMediaAttrName");
NamedStates.ClearNamedState("playMediaAttrValue");
NamedStates.ClearNamedState("playMediaTypeName");
NamedStates.ClearNamedState("playMediaTypeValue");
chosen = findMatchingItem(matchingGenres, chosen, "WM/Genre", "Genre");
chosen = findMatchingItem(matchingArtists, chosen, "WM/AlbumArtist", "Artist");
chosen = findMatchingItem(matchingAlbums, chosen, "WM/AlbumTitle", "Album");
chosen = findMatchingItem(matchingTracks, chosen, "SourceURL", "Track");
if (NamedStates.IsNamedStateSet("playMediaAttrName") && NamedStates.IsNamedStateSet("playMediaAttrValue"))
{
Application.EmulateRecognition("Play what I asked for");
}
function addMediaItems(prefix, itemsToAdd, collectionToAddTo)
{
for (i = 0; i < itemsToAdd.Count; i++)
{
item = itemsToAdd.item(i);
collectionToAddTo.AddItem(prefix + " " + item.Phrase, item.Property);
}
}
function findMatchingItem(matchingItems, chosen, playMediaAttrName, playMediaTypeName)
{
if (chosen >= 0 && chosen < matchingItems.Count)
{
NamedStates.SetNamedStateValue("playMediaAttrName", playMediaAttrName);
NamedStates.SetNamedStateValue("playMediaAttrValue", matchingItems.Item(chosen).Property);
NamedStates.SetNamedStateValue("playMediaTypeName", playMediaTypeName);
NamedStates.SetNamedStateValue("playMediaTypeValue", matchingItems.Item(chosen).Phrase);
chosen = -1;
}
else
{
chosen = chosen - matchingItems.Count;
}
return chosen;
}
]]>
</script>
</command>
<!-- Play Artist/Album/Track/Genre Command -->
<command>
<listenForList propname="PlayWhat">
<item propval="Genres">Play Genre</item>
<item propval="Genres">+Genres</item>
<item propval="Artists">Play Artist</item>
<item propval="Artists">+Artists</item>
<item propval="Albums">Play Album</item>
<item propval="Albums">Play C D</item>
<item propval="Albums">+Albums</item>
<item propval="Albums">+C +Ds</item>
<item propval="TrackNames">Play Song</item>
<item propval="TrackNames">Play Track</item>
<item propval="TrackNames">+Song</item>
<item propval="TrackNames">+Tracks</item>
</listenForList>
<setTextFeedback>Playing {[*PlayWhat]}</setTextFeedback>
<wmpMediaControl command="pause"/>
<script language="JScript" >
<![CDATA[
playWhat = "{[PlayWhat]}";
matchingItems = CommandSet.RuleGenerators(playWhat).Rule.Items;
addMediaItems("", matchingItems, ChooseFromList.Items);
if (ChooseFromList.Items.Count == 0)
{
Command.Exit(1);
}
chosen = ChooseFromList.Items.Count == 1
? 0
: ChooseFromList.Choose("What did you want to play?", "Play " + playWhat);
NamedStates.ClearNamedState("playMediaAttrName");
NamedStates.ClearNamedState("playMediaAttrValue");
NamedStates.ClearNamedState("playMediaTypeName");
NamedStates.ClearNamedState("playMediaTypeValue");
if (playWhat == "Genres") {
playMediaTypeName = "Genre";
playMediaAttrName = "WM/Genre";
}
else if (playWhat == "Artists") {
playMediaTypeName = "Artist";
playMediaAttrName = "WM/AlbumArtist";
}
else if (playWhat == "Albums") {
playMediaTypeName = "Album";
playMediaAttrName = "WM/AlbumTitle";
}
else if (playWhat == "TrackNames") {
playMediaTypeName = "Track";
playMediaAttrName = "SourceURL";
}
chosen = findMatchingItem(matchingItems, chosen, playMediaAttrName, playMediaTypeName);
if (NamedStates.IsNamedStateSet("playMediaAttrName") && NamedStates.IsNamedStateSet("playMediaAttrValue"))
{
Application.EmulateRecognition("Play what I asked for");
}
function addMediaItems(prefix, itemsToAdd, collectionToAddTo)
{
for (i = 0; i < itemsToAdd.Count; i++)
{
item = itemsToAdd.item(i);
collectionToAddTo.AddItem(prefix + " " + item.Phrase, item.Property);
}
}
function findMatchingItem(matchingItems, chosen, playMediaAttrName, playMediaTypeName)
{
if (chosen >= 0 && chosen < matchingItems.Count)
{
NamedStates.SetNamedStateValue("playMediaAttrName", playMediaAttrName);
NamedStates.SetNamedStateValue("playMediaAttrValue", matchingItems.Item(chosen).Property);
NamedStates.SetNamedStateValue("playMediaTypeName", playMediaTypeName);
NamedStates.SetNamedStateValue("playMediaTypeValue", matchingItems.Item(chosen).Phrase);
chosen = -1;
}
else
{
chosen = chosen - matchingItems.Count;
}
return chosen;
}
]]>
</script>
</command>
<!-- Play the album that has [track name] on it -->
<command>
<listenFor>Play the album that has [AlbumByTrackName] on it</listenFor>
<listenFor>Play the C D that has [AlbumByTrackName] on it</listenFor>
<setTextFeedback>Playing the Album that has {[*AlbumByTrackName]} on it</setTextFeedback>
<wmpMediaControl command="pause"/>
<disambiguate title="Which track's album do you want to play?" prompt="Choose a Track" timeout="25" propname="AlbumByTrackName"/>
<setState name="playMediaTypeName" value="Album"/>
<setState name="playMediaTypeValue" value="{[Album]}"/>
<setState name="playMediaAttrName" value="WM/AlbumTitle"/>
<setState name="playMediaAttrValue" value="{[Album]}"/>
<emulateRecognition>Play what I asked for</emulateRecognition>
</command>
<!-- Play the artist that sang [track name] -->
<command>
<listenFor>Play the artist that sang [ArtistByTrackName]</listenFor>
<listenFor>Play the artist who sang [ArtistByTrackName]</listenFor>
<listenFor>Play the band that sang [ArtistByTrackName]</listenFor>
<listenFor>Play the band who sang [ArtistByTrackName]</listenFor>
<listenFor>Play the group that sang [ArtistByTrackName]</listenFor>
<listenFor>Play the group who sang [ArtistByTrackName]</listenFor>
<setTextFeedback>Playing the artist that sang {[*ArtistByTrackName]}</setTextFeedback>
<wmpMediaControl command="pause"/>
<disambiguate title="Which track's artist do you want to play?" prompt="Choose a Track" timeout="25" propname="ArtistByTrackName"/>
<setState name="playMediaTypeName" value="Artist"/>
<setState name="playMediaTypeValue" value="{[Artist]}"/>
<setState name="playMediaAttrName" value="Author"/>
<setState name="playMediaAttrValue" value="{[Artist]}"/>
<emulateRecognition>Play what I asked for</emulateRecognition>
</command>
<!-- Play something sang by [TrackOrAlbumByArtist] -->
<command>
<listenFor>Play something ?sang by [TrackOrAlbumByArtist]</listenFor>
<listenFor>Play something [TrackOrAlbumByArtist]</listenFor>
<listenFor>Play something [TrackOrAlbumByArtist] sang</listenFor>
<setTextFeedback>Playing something by {[*TrackOrAlbumByArtist]}</setTextFeedback>
<wmpMediaControl command="pause"/>
<script language="JScript" > We're
<![CDATA[
trackOrAlbumByArtist = "{[*TrackOrAlbumByArtist]}";
matchingAlbums = CommandSet.RuleGenerators("AlbumByArtist").Rule.Items.FindTextMatches(trackOrAlbumByArtist);
matchingTracks = CommandSet.RuleGenerators("TrackNameByArtist").Rule.Items.FindTextMatches(trackOrAlbumByArtist)
addMediaItems("Album:", matchingAlbums, ChooseFromList.Items);
addMediaItems("Track:", matchingTracks, ChooseFromList.Items);
if (ChooseFromList.Items.Count == 0)
{
Command.Exit(1);
}
chosen = ChooseFromList.Items.Count == 1
? 0
: ChooseFromList.Choose("What do you want to play?", "Play media");
NamedStates.ClearNamedState("playMediaAttrName");
NamedStates.ClearNamedState("playMediaAttrValue");
NamedStates.ClearNamedState("playMediaTypeName");
NamedStates.ClearNamedState("playMediaTypeValue");
chosen = findMatchingItem(matchingAlbums, chosen, "WM/AlbumTitle", "Album");
chosen = findMatchingItem(matchingTracks, chosen, "Name", "Track");
if (NamedStates.IsNamedStateSet("playMediaAttrName") && NamedStates.IsNamedStateSet("playMediaAttrValue"))
{
Application.EmulateRecognition("Play what I asked for");
}
function addMediaItems(prefix, itemsToAdd, collectionToAddTo)
{
for (i = 0; i < itemsToAdd.Count; i++)
{
item = itemsToAdd.item(i);
collectionToAddTo.AddItem(prefix + " " + item.Property + " (" + item.Phrase + ")", item.Property);
}
}
function findMatchingItem(matchingItems, chosen, playMediaAttrName, playMediaTypeName)
{
if (chosen >= 0 && chosen < matchingItems.Count)
{
NamedStates.SetNamedStateValue("playMediaAttrName", playMediaAttrName);
NamedStates.SetNamedStateValue("playMediaAttrValue", matchingItems.Item(chosen).Property);
NamedStates.SetNamedStateValue("playMediaTypeName", playMediaTypeName);
NamedStates.SetNamedStateValue("playMediaTypeValue", matchingItems.Item(chosen).Property);
chosen = -1;
}
else
{
chosen = chosen - matchingItems.Count;
}
return chosen;
}
]]>
</script>
</command>
<!-- Play what I asked for -->
<command>
<listenFor>Play what I asked for ?again</listenFor>
<wmpMediaControl command="stop"/>
<setTextFeedback speak="true">Playing {[playMediaTypeName]} {[playMediaTypeValue]}</setTextFeedback>
<wmpMediaPlay attrname="{[playMediaAttrName]}" attrvalue="{[playMediaAttrValue]}"/>
</command>
<!-- Navigation -->
<command>
<listenFor>+next track</listenFor>
<listenFor>+next song</listenFor>
<listenFor>+go to ?the +next ?track</listenFor>
<listenFor>+go to ?the +next song</listenFor>
<wmpMediaControl command="stop"/>
<speak>Playing the next track</speak>
<wmpMediaControl command="next"/>
<waitFor seconds=".5"/>
<wmpMediaControl command="play"/>
</command>
<command>
<listenFor>+previous track</listenFor>
<listenFor>+previous song</listenFor>
<listenFor>+go to ?the +previous ?track</listenFor>
<listenFor>+go to ?the +previous song</listenFor>
<wmpMediaControl command="stop"/>
<speak>Playing the previous track</speak>
<wmpMediaControl command="previous"/>
<waitFor seconds=".5"/>
<wmpMediaControl command="play"/>
</command>
<command>
<listenFor>[GoBack] one track</listenFor>
<listenFor>[GoBack] one song</listenFor>
<listenFor>[GoBack] [1to20times] tracks</listenFor>
<listenFor>[GoBack] [1to20times] songs</listenFor>
<wmpMediaControl command="stop"/>
<speak>Skipping back {[times]} tracks</speak>
<wmpMediaControl command="previous" times="{[times]}"/>
<waitFor seconds=".5"/>
<wmpMediaControl command="play"/>
</command>
<command>
<listenFor>[GoForward] one track</listenFor>
<listenFor>[GoForward] one song</listenFor>
<listenFor>[GoForward] [1to20times] tracks</listenFor>
<listenFor>[GoForward] [1to20times] songs</listenFor>
<wmpMediaControl command="stop"/>
<speak>Skipping ahead {[times]} tracks</speak>
<wmpMediaControl command="next" times="{[times]}"/>
<waitFor seconds=".5"/>
<wmpMediaControl command="play"/>
</command>
<command>
<listenFor>+play music</listenFor>
<wmpMediaControl command="play"/>
</command>
<command>
<listenFor>+stop music</listenFor>
<listenFor>+stop playing ?music</listenFor>
<wmpMediaControl command="stop"/>
</command>
<command>
<listenFor>+pause music</listenFor>
<wmpMediaControl command="pause"/>
</command>
<command>
<listenFor>+Repeat +on</listenFor>
<listenFor>Turn on +repeat</listenFor>
<listenFor>Turn +repeat on</listenFor>
<wmpMediaControl command="loop_on"/>
<wmpMediaControl command="pause"/>
<speak>Repeat is now turned on</speak>
<wmpMediaControl command="play"/>
</command>
<command>
<listenFor>+Repeat +off</listenFor>
<listenFor>Turn +off +repeat</listenFor>
<listenFor>Turn +repeat +off</listenFor>
<wmpMediaControl command="loop_off"/>
<wmpMediaControl command="pause"/>
<speak>Repeat is now turned off</speak>
<wmpMediaControl command="play"/>
</command>
<command>
<listenFor>?Toggle +repeat ?setting</listenFor>
<wmpMediaControl command="loop_toggle"/>
<wmpMediaControl command="pause"/>
<speak>Toggled the repeat setting</speak>
<wmpMediaControl command="play"/>
</command>
<command>
<listenFor>+Shuffle +on</listenFor>
<listenFor>Turn +on +shuffle</listenFor>
<listenFor>Turn +shuffle +on</listenFor>
<wmpMediaControl command="shuffle_on"/>
<wmpMediaControl command="pause"/>
<speak>Shuffle is now turned on</speak>
<wmpMediaControl command="play"/>
</command>
<command>
<listenFor>+Shuffle +off</listenFor>
<listenFor>Turn +off +shuffle</listenFor>
<listenFor>Turn +shuffle +off</listenFor>
<wmpMediaControl command="shuffle_off"/>
<wmpMediaControl command="pause"/>
<speak>Shuffle is now turned off</speak>
<wmpMediaControl command="play"/>
</command>
<command>
<listenFor>?Toggle +shuffle ?setting</listenFor>
<wmpMediaControl command="shuffle_toggle"/>
<wmpMediaControl command="pause"/>
<speak>Toggled the shuffle setting</speak>
<wmpMediaControl command="play"/>
</command>
<!-- Command Set Rules -->
<!-- Various ways to say, "Go Back" -->
<listenForList name="GoBack">
<item>+go +back</item>
<item>+go +up</item>
<item>+go +down</item>
<item>+skip +back</item>
<item>+skip +up</item>
<item>+skip +down</item>
</listenForList>
<!-- Various ways to say, "Go Forward"-->
<listenForList name="GoForward">
<item>+go +forward</item>
<item>+go +ahead</item>
<item>+go +down</item>
<item>+skip +forward</item>
<item>+skip +ahead</item>
<item>+skip +down</item>
</listenForList>
<numbers name="1to20times" propname="times" start="1" stop="20"/>
<wmpMediaItems
name="Artists"
propname="Artist"
attrname="Author"
useSubset="false"
/>
<wmpMediaItems
name="Albums"
propname="Album"
attrname="WM/AlbumTitle"
useSubset="false"
/>
<wmpMediaItems
name="Genres"
propname="Genre"
attrname="WM/Genre"
/>
<wmpMediaItems
name="TrackNames"
propname="SourceURL"
propvalue="[SourceURL]"
attrname="MediaType"
attrvalue="AUDIO"
listenFor="[Name]"
useSubset="false"
/>
<wmpMediaItems
name="AlbumByTrackName"
propname="Album"
propvalue="[WM/AlbumTitle]"
attrname="MediaType"
attrvalue="AUDIO"
listenFor="[Name]"
useSubset="false"
/>
<wmpMediaItems
name="ArtistByTrackName"
propname="Artist"
propvalue="[Author]"
attrname="MediaType"
attrvalue="AUDIO"
listenFor="[Name]"
useSubset="false"
/>
<rule name="GenreArtistAlbumTrack">
<list>
<ruleref name="TrackNames"/>
<ruleref name="Artists"/>
<ruleref name="Albums"/>
<ruleref name="Genres"/>
</list>
</rule>
<wmpMediaItems
name="TrackNameByArtist"
propname="TrackName"
propvalue="[Name]"
attrname="MediaType"
attrvalue="AUDIO"
listenFor="[Author]"
useSubset="false"
/>
<wmpMediaItems
name="AlbumByArtist"
propname="Album"
propvalue="[WM/AlbumTitle]"
attrname="MediaType"
attrvalue="AUDIO"
listenFor="[Author]"
useSubset="false"
/>
<rule name="TrackOrAlbumByArtist">
<list>
<ruleref name="TrackNameByArtist"/>
<ruleref name="AlbumByArtist"/>
</list>
</rule>
<Signature>
MIIDnQYJKoZIhvcNAQcCoIIDjjCCA4oCAQExCzAJBgUrDgMCGgUAMGcGCisGAQQBgjcCAQSgWTBX
MDIGCisGAQQBgjcCAR4wJAIBAQQQQf9itGlsy0O8AOWC49jANAIBAAIBAAIBAAIBAAIBADAhMAkG
BSsOAwIaBQAEFEgiq29ythsc5lX3xdgJ2akLhkUCoIIBzTCCAckwggEyoAMCAQICEE5IUIO4o4S4
TOic6w//gw0wDQYJKoZIhvcNAQEFBQAwEDEOMAwGA1UEAxMFU2Vib3IwHhcNMTEwNDE2MTM0MjQz
WhcNMTIwNDE1MTk0MjQzWjAQMQ4wDAYDVQQDEwVTZWJvcjCBnzANBgkqhkiG9w0BAQEFAAOBjQAw
gYkCgYEAqWAtd0kAfprRoGWd5JRMJgpKbtIkgr0jSGUPhAOgozhTwOLKpCNEeLxDigCTS2PnJjv9
Hxad4O49XJmgmigj9cRZeVDvDSvS258VkrIIHne/ejRRldlXmeBcCz6SPXHr0PW13Fgu5r1I2bNN
OEULjvkVGNEZtzruDtM4DjK0Vr0CAwEAAaMkMCIwCwYDVR0PBAQDAgeAMBMGA1UdJQQMMAoGCCsG
AQUFBwMDMA0GCSqGSIb3DQEBBQUAA4GBADEl+Y9r+WoBMyn3KHLr4vvv7qPvXPTzntw9P2rsghcc
fdH2AiAZNCcmd6Or/0T9IkWU4/mOG/LqOX9LqzPkMsAOW7YfyVHB3QJ4B3NbwI+RZIergjQMrVhs
Y4Q7VE99KkE1JtL1qZacmvXQZF0pJzbHKXNS7Y6pW3caGGPob75GMYIBPDCCATgCAQEwJDAQMQ4w
DAYDVQQDEwVTZWJvcgIQTkhQg7ijhLhM6JzrD/+DDTAJBgUrDgMCGgUAoHAwEAYKKwYBBAGCNwIB
DDECMAAwGQYJKoZIhvcNAQkDMQwGCisGAQQBgjcCAQQwHAYKKwYBBAGCNwIBCzEOMAwGCisGAQQB
gjcCARUwIwYJKoZIhvcNAQkEMRYEFC8hO1KcVHXSEM7mKYrZB1eJT3BYMA0GCSqGSIb3DQEBAQUA
BIGAcxaX/ttUH6eluQmlLWkK/78GmPYQUNhsti7CXz4RWracvld0yhuesTrFqTF7ziuHvNILkH9Q
4HsO0o5YsqQCKx4Adfc75rWwVVIry2avHzUPkCLEyvlGsXPmrZ3QmZ9eTDmWNJXKIEIFCqon4bcn
lvWb37NKI93LWz8XD9KGGnQ=
</Signature>
</speechMacros>
Push to Talk Funktion für Windows Speech Recognition
I wasn't exactly sure where to post this, but I guess I'll just leave it here for now.
--
So, I figured that most of you probably don't know about this yet, so for your information:
The Basic Windows Speech Recognition has a hotkey that will toggle the microphone between sleeping and listening. This combination is
Ctrl + Windows Key
So far, so good. If you have the Windows Speech Recognition Macros running, this behaviour gets modified. It now switches between off and listening. Also, and more importantly, if you press the combination for more than 500ms, it will exhibit a "push to talk" function, as in it will listen as long as you are pressing the buttons down and then go back to offline. So far, so awesome. Now Ctrl + Win isn't the best possible hotkey so I was looking for a way to modify it, and I eventually came up with something.
First, you need to download and install AutoHotkey: AutoHotkey Download
This is a very powerful tool that will let you create complex macros for various hotkeys (e.g. insert a whole lot of text by pressing some key combination), and will also let you substitute keys on your keyboard with each other (e.g. if you press b, it will type a if you want to).
There is a comprehensive help file that comes along with the tool if you wanna know more about it, but for our purposes, here is the script that will function as our push to talk button:
~Xbutton2::
Send {LCtrl down}+{Lwin down}
KeyWait, Xbutton2
Send {LCtrl up}+{Lwin up}
return
Replace both Xbutton2 instances with the key you actually want to use (check the Auto Hotkey helpfile for a list of all possible keys).
That's it, thats all that it takes. Xbutton2 is the 5th mouse button if you happen to have such a thing, but basically you can use any key instead of Xbutton2 (eg. you could use Insert or Home, or Tab. IMPORTANT: Unless you put that tilde ( ~ ) in front of the Key you want to assign, it will not retain it's original functionality. WITH the ~, it will do BOTH: act as the push to talk button AND the keys original purpose. It's up to you if you want that or not of course. If you remove the tilde, the original function of the key will be disabled as long as the AutoHotkey script is running. ).
This script emulates the exact behaviour of the Ctrl+Win combination: if you press the key/button only shortly, the microphone will toggle between listening/offline. If you hold down the key/button, it will listen as long as its pushed down and go back to offline as soon as you release it.
Best regards.
Lautstärkenregelung
Here is a simple Macro that will lower/increase the Windows System Volume.
First, you need to download and install this little tool: Sound Volume Hotkeys - Control sound volume using system-wide hotkeys.
It will run in the background and add the hotkeys ctrl up and ctrl down to modify the system volume.
We can now use a WSR Macro to do this for us.
You can say: volume up / louder or volume down / quiter
and also "silence i kill you" for mute and my personal favorite "turn it to eleven" for max volume
Best Regards
Code:
<?xml version="1.0" encoding="UTF-16"?>
<speechMacros>
<command>
<listenFor>louder</listenFor>
<listenFor>volume up</listenFor>
<sendKeys>{{CTRL}}{{up}}{{up}}{{up}}{up}</sendKeys>
</command>
<command>
<listenFor>quiter</listenFor>
<listenFor>volume down</listenFor>
<sendKeys>{{CTRL}}{{down}}{{down}}{{down}}{down}</sendKeys>
</command>
<command>
<listenFor>mute</listenFor>
<listenFor>silence i kill you</listenFor>
<sendKeys>{{CTRL}}{{down}}{{down}}{{down}}{{down}}{{down}}{{down}}{{down}}{{down}}{{down}}{{down}}{{down}}{{down}}{{down}}{{down}}{{down}}{{down}}{{down}}{{down}}{{down}}{{down}}{{down}}{{down}}{{down}}{{down}}{{down}}{{down}}{{down}}{{down}}{{down}}{{down}}{{down}}{{down}}{{down}}{down}</sendKeys>
</command>
<command>
<listenFor>max volume</listenFor>
<listenFor>turn it to eleven</listenFor>
<sendKeys>{{CTRL}}{{up}}{{up}}{{up}}{{up}}{{up}}{{up}}{{up}}{{up}}{{up}}{{up}}{{up}}{{up}}{{up}}{{up}}{{up}}{{up}}{{up}}{{up}}{{up}}{{up}}{{up}}{{up}}{{up}}{{up}}{{up}}{{up}}{{up}}{{up}}{{up}}{{up}}{{up}}{{up}}{{up}}{{up}}{up}</sendKeys>
</command>
<Signature>
MIIDnQYJKoZIhvcNAQcCoIIDjjCCA4oCAQExCzAJBgUrDgMCGgUAMGcGCisGAQQBgjcCAQSgWTBX
MDIGCisGAQQBgjcCAR4wJAIBAQQQQf9itGlsy0O8AOWC49jANAIBAAIBAAIBAAIBAAIBADAhMAkG
BSsOAwIaBQAEFJT8Zia3vHPqqQYC68nU1vxDkhXfoIIBzTCCAckwggEyoAMCAQICEE5IUIO4o4S4
TOic6w//gw0wDQYJKoZIhvcNAQEFBQAwEDEOMAwGA1UEAxMFU2Vib3IwHhcNMTEwNDE2MTM0MjQz
WhcNMTIwNDE1MTk0MjQzWjAQMQ4wDAYDVQQDEwVTZWJvcjCBnzANBgkqhkiG9w0BAQEFAAOBjQAw
gYkCgYEAqWAtd0kAfprRoGWd5JRMJgpKbtIkgr0jSGUPhAOgozhTwOLKpCNEeLxDigCTS2PnJjv9
Hxad4O49XJmgmigj9cRZeVDvDSvS258VkrIIHne/ejRRldlXmeBcCz6SPXHr0PW13Fgu5r1I2bNN
OEULjvkVGNEZtzruDtM4DjK0Vr0CAwEAAaMkMCIwCwYDVR0PBAQDAgeAMBMGA1UdJQQMMAoGCCsG
AQUFBwMDMA0GCSqGSIb3DQEBBQUAA4GBADEl+Y9r+WoBMyn3KHLr4vvv7qPvXPTzntw9P2rsghcc
fdH2AiAZNCcmd6Or/0T9IkWU4/mOG/LqOX9LqzPkMsAOW7YfyVHB3QJ4B3NbwI+RZIergjQMrVhs
Y4Q7VE99KkE1JtL1qZacmvXQZF0pJzbHKXNS7Y6pW3caGGPob75GMYIBPDCCATgCAQEwJDAQMQ4w
DAYDVQQDEwVTZWJvcgIQTkhQg7ijhLhM6JzrD/+DDTAJBgUrDgMCGgUAoHAwEAYKKwYBBAGCNwIB
DDECMAAwGQYJKoZIhvcNAQkDMQwGCisGAQQBgjcCAQQwHAYKKwYBBAGCNwIBCzEOMAwGCisGAQQB
gjcCARUwIwYJKoZIhvcNAQkEMRYEFEdPRoEiXFae0xYN2qPSHHg2kPQxMA0GCSqGSIb3DQEBAQUA
BIGAgo3wybceZRlHdcDv3DHoC9RbOHCG59wznoxuHhbMLB3j6S/FfNJRmFVOoIvFmfzIb2GVB3gf
CdlrLEcMA2h6fKOChwQX6E5fBFDnv/7oV6VdE9FJ/oXCUKeZOu2bXJt/+ic2TzpDuovm3U1P2tyy
KUnVOBk3/CFLG4TQyRZD1BQ=
</Signature>
</speechMacros>
HULDIGT DEM MEISTER DER LANGEWEILE!
Zuletzt bearbeitet: