Last active
May 28, 2022 21:51
-
-
Save seksenov/17032e9a6eb9c17f88b5 to your computer and use it in GitHub Desktop.
Revisions
-
seksenov revised this gist
Jun 30, 2015 . 1 changed file with 1 addition and 1 deletion.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -2,7 +2,7 @@ <html> <head> <title>Cortana Example</title> <!--Cortana meta tag pointing to VCD file on the server--> <meta name="msapplication-cortanavcd" content="https://mysite.com/vcd.xml"/> </head> <body> -
seksenov revised this gist
Jun 30, 2015 . 1 changed file with 1 addition and 1 deletion.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -2,7 +2,7 @@ <html> <head> <title>Cortana Example</title> <!--Cortana meta tag pointing to VCD file on the server--> <meta name="msapplication-cortanavcd" content="https://mysite.com/vcd.xml"/> </head> <body> -
seksenov created this gist
Jun 30, 2015 .There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,11 @@ <!DOCTYPE html> <html> <head> <title>Cortana Example</title> <!--Cortana meta tag--> <meta name="msapplication-cortanavcd" content="https://mysite.com/vcd.xml"/> </head> <body> </body> </html> This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,33 @@ if (typeof Windows !== 'undefined' && typeof Windows.UI !== 'undefined' && typeof Windows.ApplicationModel !== 'undefined') { // Subscribe to the Windows Activation Event Windows.UI.WebUI.WebUIApplication.addEventListener("activated", function (args) { var activation = Windows.ApplicationModel.Activation; // Check to see if the app was activated by a voice command if (args.kind === activation.ActivationKind.voiceCommand) { // Get the speech reco var speechRecognitionResult = args.result; var textSpoken = speechRecognitionResult.text; // Determine the command type {search} defined in vcd if (speechRecognitionResult.rulePath[0] === "search") { // Determine the stream name specified if (textSpoken.includes('foo') || textSpoken.includes('Foo')) { console.log("The user is searching for foo"); } else if (textSpoken.includes('bar') || textSpoken.includes('Bar') ) { console.log("The user is searching for a bar"); } else { console.log("Invalid search term specified by user"); } } else { console.log("No valid command specified"); } } }); } else { console.log("Windows namespace is unavaiable"); } This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,14 @@ <?xml version="1.0" encoding="utf-8"?> <VoiceCommands xmlns="http://schemas.microsoft.com/voicecommands/1.2"> <CommandSet xml:lang="en-us" Name="RJS"> <CommandPrefix>MyApp</CommandPrefix> <Example>MyApp search for foo</Example> <Command Name="Search"> <Example>search {message} using myapp</Example> <ListenFor RequireAppName="BeforeOrAfterPhrase">Search for {searchTerm}</ListenFor> <Feedback>Searching for {searchTerm} with MyApp</Feedback> <Navigate Target="/search.htm"/> </Command> <PhraseTopic Label="searchTerm" Scenario="Dictation"></PhraseTopic> </CommandSet> </VoiceCommands>