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