MSDN How do I add Voice Commands to my application Find Install Voice Command Sets Search Search for {dictatedSearchTerms} Find Find.

Slides:



Advertisements
Similar presentations
.NET Core Libraries Common Language Runtime CodeGen Garbage Collector Security Model Exception Handling Loader & Binder Profiling & Debugging APIs Entity.
Advertisements

Cosc 5/4730 Android Services. What is a service? From android developer web pages: Most confusion about the Service class actually revolves around what.
Developing for Windows 8/WinRT Session 4 Fundamentals Kevin Stumpf.
1 Nuance Mobile Developer Program Case Studies. NMDP Case Study – Amazon Price Check Price Comparison app for the iPhone Allows shoppers to locate the.
CS 4800 By Brandon Andrews.  Specifications  Goals  Applications  Design Steps  Testing.
Build /16/2017 © 2015 Microsoft Corporation. All rights reserved. MICROSOFT MAKES NO WARRANTIES, EXPRESS, IMPLIED OR STATUTORY, AS TO THE INFORMATION.
Introduction to VXML. What is VXML? Voice Extensible Markup Language Used in telephone-based speech applications voice browsing of the web.
Charles Petzold Navigation.
Dragon Naturally Speaking Tutorial What is Dragon Naturally Speaking? Dragon is a dictation software, students can dictate a paper rather than type it.
30 April 2014 Building Apps for Windows Phone 8.1 Jump Start WinRT Apps & Silverlight.
Introducing Xamarin 2.0 Introducing Xamarin 2.0 Michael Hutchinson
Recognizes: Magic Memo, show me memo number three. Magic Memo, show memo one. Magic Memo, display memo number two. Magic Memo, display memo.
Managed Code Generics Language Integrated Query Dynamic + Language Parity C# VB 11.0 Windows Runtime + Asynchrony C# VB 7.0 C# VB.
Should Intelligent Agents Listen and Speak to Us? James A. Larson Larson Technical Services
PHP : Hypertext Preprocessor
Introducing Visual Studio ® LightSwitch™ Andrew Coates Microsoft DEV201 #auteched #dev201.
Introduction to Silverlight. Slide 2 What is Silverlight? It’s part of a Microsoft Web platform called Rich Internet Applications (RIA) There is a service.
Liang, Introduction to Java Programming, Eighth Edition, (c) 2011 Pearson Education, Inc. All rights reserved Concurrency in Android with.
Designing metro style apps for Windows 8 A walkthrough some UI / UX best practices Lanny Geffen, Creative Director, Digiflare.
Rujchai Ung-arunyawee Department of Computer Engineering Khon Kaen University.
Agenda Windows Phone History WP 7.0 Silverlight WP 7.5 Silverlight WP 8.0 Silverlight WP 8.1 Silverlight WP 8.1 WinRT.
Windows Phone 8 Tips & Tricks for Developers Sascha Corti, Microsoft Switzerland Technical Evangelist | techpreacher.corti.com.
Getting Started with Caliburn.Micro and Windows Phone 7 Gary Ewan Park Twitter: Blog:
© Copyright by Deitel & Associates, Inc. and Pearson Education Inc. All Rights Reserved. 1 Tutorial 27 - Phone Book Application Introducing Multimedia.
Online Service 1. Authorization Request (Start URL) 2. Login page 3. Credentials 4. Authorization page 5. User decision 6. Authorization.
Program documentation Using the Doxygen tool Program documentation1.
Web hosting in app Creating a Windows Store app with web assets.
The Windows Runtime (WinRT) is the shared runtime and API space used by store apps across the Windows platform (phone and client) 5 Common WinRT.
Microsoft Virtual Academy North Shore.NET User Group Our Sponsors.
Lecture 11 Dynamic link libraries. Differences between static libraries and DLLs In static library code is added to the executable. In DLL, the code is.
private void Goto2(object sender, Windows.UI.Xaml.RoutedEventArgs e) { var app = App.Current as Common.BootStrapper; var nav = app.NavigationService;
Developer's guide to Windows 10 Insider Preview Andy & Jerry
Joe Hummel, the compiler is at your service Chicago Code Camp 2014.
BEGINNING PROGRAMMING.  Literally – giving instructions to a computer so that it does what you want  Practically – using a programming language (such.
Note Search Hanna Filipsson Nathan Fong Brian Watanabe Taryn Wise.
IAsyncResult ar = BeginSomething(…); // Do other work, checking ar.IsCompleted int result = EndSomething(ar);
C++ / G4MICE Course Session 2 Basic C++ types. Control and Looping Functions in C Function/method signatures and scope.
Talking to Robots Using MS Speech SDK 5.1 in C# Sebastian van Delden USC Upstate
Introduction into JavaScript Java 1 JavaScript JavaScript programs run from within an HTML document The statements that make up a program in an HTML.
CIS Intro to JAVA Lecture Notes Set July-05 GUI Programming –TextField Action Listeners, JEditorPane action listeners, HTML in a JEditorPane,
Visual 1: Working with Visual Analysis Agenda Overview of the Preview Panel –Breakdown of its components and how to use Visual Analysis –Text and.
PROGRAMMING IN PYTHON LETS LEARN SOME CODE TOGETHER!
Jerry Nixon | Microsoft Developer Evangelist Daren May | President & Co-founder, Crank211.
04 |Sharing Code Between Windows 8 and Windows Phone 8 in Visual Studio Ben Riga
Python Lesson 1 1. Starter Create the following Excel spreadsheet and complete the calculations using formulae: 2 Add A1 and B1 A2 minus B2 A3 times B3.
Integral Users will interact with your app on a big screen with keyboard and mouse.
Cosc 4735 Permissions Asking for them in API 23+.
Cosc 5/4735 YouTube API. YouTube The YouTube Android Player API enables you to incorporate video playback functionality into your Android applications.
Cosc 5/4735 Voice Actions Voice Interactions (API 23+)
Agenda UCMA 3.0 Highlights Management PowerShell cmdlets to create and manage UCMA trusted applications and endpoints. Autoprovisioning Application.
Task Pane App adjacent to the document Content App in the body of the document Mail Inline Pane on an or appointment item.
APLIKACIJE KOJE SU IZVAN SEBE Domagoj Pavlešić, dizzy.hr.
Spaso Lazarević Microsoft MVP Nova banka ad Banja Luka Building business application using Visual Studio 2013 LightSwitch.
IBM Software Group © 2009 IBM Corporation IBM Tivoli Provisioning Manager Inventory Extension.
Joe Hummel, the compiler is at your service Chicago Coder Conference, June 2016.
Vaughan Knight App Ecosystem Lead Microsoft FileOpenPicke r, FileSavePicker Read/Write access to SD card Appointments /Calendar API enhancements Appointments.
Microsoft Cortana for App Developers
Windows Calls Applications (windows.applicationmodel.calls)
Windows Developer Day Fall Creators Update Chris Cortes
Customizing your device experience with assigned access
Explain what touch develop is to your students:
What’s New in Accessibility (for Developers and Users)
Retrieval of audio testimonials via voice search
Windows Runtime App Lifecycle
David Cyphert CS 2310 – Software Engineering
File type associations and AutoPlay
4/9/ | Contracts © 2012 Microsoft Corporation. All rights reserved. Microsoft, Windows, and other product names are or may be registered trademarks.
User Segmentation and Targeted Push Notifications for UWP apps
03 | Async Programming & Networking Intro
Ch07 生命週期(Life Cycle).
Presentation transcript:

MSDN How do I add Voice Commands to my application Find Install Voice Command Sets Search Search for {dictatedSearchTerms} Find Find {dictatedSearchTerms} Search on MSDN How do I add Voice Commands to my application {dictatedVoiceCommandText} Starting MSDN... MSDN MSDN

MSDN How do I add Voice Commands to my application Find Install Voice Command Sets Search Search for {dictatedSearchTerms} Find Find {dictatedSearchTerms} Search on MSDN How do I add Voice Commands to my application {dictatedVoiceCommandText} Starting MSDN... MSDN MSDN MSDN

MSDN How do I add Voice Commands to my application Find Install Voice Command Sets Search Search for {dictatedSearchTerms} Find Find {dictatedSearchTerms} Search on MSDN How do I add Voice Commands to my application {dictatedVoiceCommandText} Starting MSDN... MSDN MSDN How do I add Voice Commands to my application

MSDN How do I add Voice Commands to my application Find Install Voice Command Sets Search Search for {dictatedSearchTerms} Find Find {dictatedSearchTerms} Search on MSDN How do I add Voice Commands to my application {dictatedVoiceCommandText} Starting MSDN... MSDN MSDN

MSDN How do I add Voice Commands to my application Find Install Voice Command Sets Search Search for {dictatedSearchTerms} Find Find {dictatedSearchTerms} Search on MSDN How do I add Voice Commands to my application {dictatedVoiceCommandText} Starting MSDN... MSDN MSDN Find Install Voice Command Sets

MSDN How do I add Voice Commands to my application Find Install Voice Command Sets Search Search for {dictatedSearchTerms} Find Find {dictatedSearchTerms} Search on MSDN How do I add Voice Commands to my application {dictatedVoiceCommandText} Starting MSDN... MSDN MSDN Search Search for {dictatedSearchTerms} Find Find {dictatedSearchTerms}

MSDN How do I add Voice Commands to my application Find Install Voice Command Sets Search Search for {dictatedSearchTerms} Find Find {dictatedSearchTerms} Search on MSDN How do I add Voice Commands to my application {dictatedVoiceCommandText} Starting MSDN... MSDN MSDN Search on MSDN

MSDN How do I add Voice Commands to my application Find Install Voice Command Sets Search Search for {dictatedSearchTerms} Find Find {dictatedSearchTerms} Search on MSDN How do I add Voice Commands to my application {dictatedVoiceCommandText} Starting MSDN... MSDN MSDN

MSDN How do I add Voice Commands to my application Find Install Voice Command Sets Search Search for {dictatedSearchTerms} Find Find {dictatedSearchTerms} Search on MSDN How do I add Voice Commands to my application {dictatedVoiceCommandText} Starting MSDN... MSDN MSDN MSDN MSDN

MSDN Find Voice Commands Find Windows Phone Search Search {*} Search for {listSearchTerms} Find Find {*} Find {listSearchTerms} Search on MSDN Voice Commands Windows Phone MSDN How do I add Voice Commands to my application Find Install Voice Command Sets Search Search for {dictatedSearchTerms} Find Find {dictatedSearchTerms} Search on MSDN MSDN Windows Phone 8.0Windows Phone 8.1 Simple Scenarios, Limited AccuracyMore Powerful, Easier, More Accurate

MSDN Find Voice Commands Find Windows Phone Search Search {*} Search for {listSearchTerms} Find Find {*} Find {listSearchTerms} Search on MSDN Voice Commands Windows Phone MSDN How do I add Voice Commands to my application How do I add Voice Commands to my application {dictatedVoiceCommandText} Starting MSDN... MSDN Windows Phone 8.0Windows Phone 8.1 Simple Scenarios, Limited Accuracy… and enables Natural Language

MSDN How do I add Voice Commands to my application Find Install Voice Command Sets Search Search for {dictatedSearchTerms} Find Find {dictatedSearchTerms} Search on MSDN How do I add Voice Commands to my application {dictatedVoiceCommandText} Starting MSDN... MSDN MSDN

Windows Phone Silverlight Apps on Windows Phone 8.1 Windows Runtime Apps on Windows Phone 8.1

❶ ❷

// Windows Phone Silverlight App, in MainPage.xaml.cs protected override void OnNavigatedTo(System.Windows.Navigation.NavigationEventArgs e) { base.OnNavigatedTo(e); if (e.NavigationMode == System.Windows.Navigation.NavigationMode.New) { string recoText = null; // What did the user say? e.g. MSDN, "Find Windows Phone Voice Commands" NavigationContext.QueryString.TryGetValue("reco", out recoText); string voiceCommandName = null; // Which command was recognized in the VCD.XML file? e.g. "FindText" NavigationContext.QueryString.TryGetValue("voiceCommandName", out voiceCommandName); string searchTerms = null; // What did the user say, for named phrase topic or list "slots"? e.g. "Windows Phone Voice Commands" NavigationContext.QueryString.TryGetValue("dictatedSearchTerms", out searchTerms); switch (voiceCommandName) // What command launched the app? { case "FindText": HandleFindText(searchTerms); break; case "nlpCommand": HandleNlpCommand(recoText); break; }

// Windows Phone Silverlight App, in MainPage.xaml.cs protected override void OnNavigatedTo(System.Windows.Navigation.NavigationEventArgs e) { base.OnNavigatedTo(e); if (e.NavigationMode == System.Windows.Navigation.NavigationMode.New) { string recoText = null; // What did the user say? e.g. MSDN, "Find Windows Phone Voice Commands" NavigationContext.QueryString.TryGetValue("reco", out recoText); string voiceCommandName = null; // Which command was recognized in the VCD.XML file? e.g. "FindText" NavigationContext.QueryString.TryGetValue("voiceCommandName", out voiceCommandName); string searchTerms = null; // What did the user say, for named phrase topic or list "slots"? e.g. "Windows Phone Voice Commands" NavigationContext.QueryString.TryGetValue("dictatedSearchTerms", out searchTerms); switch (voiceCommandName) // What command launched the app? { case "FindText": HandleFindText(searchTerms); break; case "nlpCommand": HandleNlpCommand(recoText); break; } // Windows Phone Silverlight App, in MainPage.xaml.cs protected override void OnNavigatedTo(System.Windows.Navigation.NavigationEventArgs e)

// Windows Phone Silverlight App, in MainPage.xaml.cs protected override void OnNavigatedTo(System.Windows.Navigation.NavigationEventArgs e) { base.OnNavigatedTo(e); if (e.NavigationMode == System.Windows.Navigation.NavigationMode.New) { string recoText = null; // What did the user say? e.g. MSDN, "Find Windows Phone Voice Commands" NavigationContext.QueryString.TryGetValue("reco", out recoText); string voiceCommandName = null; // Which command was recognized in the VCD.XML file? e.g. "FindText" NavigationContext.QueryString.TryGetValue("voiceCommandName", out voiceCommandName); string searchTerms = null; // What did the user say, for named phrase topic or list "slots"? e.g. "Windows Phone Voice Commands" NavigationContext.QueryString.TryGetValue("dictatedSearchTerms", out searchTerms); switch (voiceCommandName) // What command launched the app? { case "FindText": HandleFindText(searchTerms); break; case "nlpCommand": HandleNlpCommand(recoText); break; } // What did the user say? e.g. MSDN, "Find Windows Phone Voice Commands" string recoText = null; NavigationContext.QueryString.TryGetValue("reco", out recoText); // Which command was recognized in the VCD.XML file? e.g. "FindText" string voiceCommandName = null; NavigationContext.QueryString.TryGetValue("voiceCommandName", out voiceCommandName); // What did the user say, for named phrase topic or list "slots"? e.g. "Windows Phone Voice Commands" string searchTerms = null; NavigationContext.QueryString.TryGetValue("dictatedSearchTerms", out searchTerms);

// Windows Phone Silverlight App, in MainPage.xaml.cs protected override void OnNavigatedTo(System.Windows.Navigation.NavigationEventArgs e) { base.OnNavigatedTo(e); if (e.NavigationMode == System.Windows.Navigation.NavigationMode.New) { string recoText = null; // What did the user say? e.g. MSDN, "Find Windows Phone Voice Commands" NavigationContext.QueryString.TryGetValue("reco", out recoText); string voiceCommandName = null; // Which command was recognized in the VCD.XML file? e.g. "FindText" NavigationContext.QueryString.TryGetValue("voiceCommandName", out voiceCommandName); string searchTerms = null; // What did the user say, for named phrase topic or list "slots"? e.g. "Windows Phone Voice Commands" NavigationContext.QueryString.TryGetValue("dictatedSearchTerms", out searchTerms); switch (voiceCommandName) // What command launched the app? { case "FindText": HandleFindText(searchTerms); break; case "nlpCommand": HandleNlpCommand(recoText); break; } switch (voiceCommandName) // What command launched the app? { case "FindText": HandleFindText(searchTerms); break; case "nlpCommand": HandleNlpCommand(recoText); break; }

❶ ❷ ❸

// Windows Runtime App on Windows Phone 8.1, inside OnActivated override // in App class if (args.Kind == ActivationKind.VoiceCommand)

VoiceCommandActivatedEventArgs vcArgs = (VoiceCommandActivatedEventArgs)args; // What command launched the app? string voiceCommandName = vcArgs.Result.RulePath.First(); // Navigate to right page for the voice command switch (voiceCommandName)

// Navigate to right page for the voice command switch (voiceCommandName) { case "FindText": // User said "find" or "search" rootFrame.Navigate(typeof(MSDN.FindText), vcArgs.Result); break; case "nlpCommand": // User said something else rootFrame.Navigate(typeof(MSDN.NlpCommand), vcArgs.Result); break; }

// Windows Runtime App on Windows Phone 8.1, inside OnNavigatedTo in FindText.xaml.cs protected override void OnNavigatedTo(NavigationEventArgs e) { // Get recognition result from parameter passed in frame.Navigate call SpeechRecognitionResult vcResult = e.Parameter as SpeechRecognitionResult; if (vcResult!=null) { // What did the user say? e.g. MSDN, "Find Windows Phone Voice Commands" string recoText = vcResult.Text; // Store the semantics dictionary for later use IReadOnlyDictionary > semantics = vcResult.SemanticInterpretation.Properties; string voiceCommandName = vcResult.RulePath.First(); if (voiceCommandName == "FindText") { // What did the user say, for named phrase topic or list "slots"? e.g. "Windows Phone Voice Commands" if (semantics.ContainsKey("dictatedSearchTerms")) { HandleFindTextWithSearchTerms(semantics["dictatedSearchTerms"][0]); } else { HandleNoSearchTerms(); } // Else handle other voice commands } navigationHelper.OnNavigatedTo(e) }

// Windows Runtime App on Windows Phone 8.1, inside OnNavigatedTo In FindText.xaml.cs protected override void OnNavigatedTo(NavigationEventArgs e) { // Get recognition result from parameter passed in frame.Navigate call SpeechRecognitionResult vcResult = e.Parameter as SpeechRecognitionResult; if (vcResult!=null) { // What did the user say? e.g. MSDN, "Find Windows Phone Voice Commands" string recoText = vcResult.Text; // Store the semantics dictionary for later use IReadOnlyDictionary > semantics = vcResult.SemanticInterpretation.Properties; string voiceCommandName = vcResult.RulePath.First(); if (voiceCommandName == "FindText") { // What did the user say, for named phrase topic or list "slots"? e.g. "Windows Phone Voice Commands" if (semantics.ContainsKey("dictatedSearchTerms")) { HandleFindTextWithSearchTerms(semantics["dictatedSearchTerms"][0]); } else { HandleNoSearchTerms(); } // Else handle other voice commands } navigationHelper.OnNavigatedTo(e) } // Windows Runtime App on Windows Phone 8.1, inside // OnNavigatedTo in FindText.xaml.cs protected override void OnNavigatedTo(NavigationEventArgs e) { // Get recognition result from parameter passed in frame.Navigate call SpeechRecognitionResult vcResult = e.Parameter as SpeechRecognitionResult; if (vcResult!=null) { // What did the user say? e.g. MSDN, "Find Windows Phone Voice Commands" string recoText = vcResult.Text; // Store the semantics dictionary for later use IReadOnlyDictionary > semantics = vcResult.SemanticInterpretation.Properties; string voiceCommandName = vcResult.RulePath.First();

// Windows Runtime App on Windows Phone 8.1, inside OnNavigatedTo In FindText.xaml.cs protected override void OnNavigatedTo(NavigationEventArgs e) { // Get recognition result from parameter passed in frame.Navigate call SpeechRecognitionResult vcResult = e.Parameter as SpeechRecognitionResult; if (vcResult!=null) { // What did the user say? e.g. MSDN, "Find Windows Phone Voice Commands" string recoText = vcResult.Text; // Store the semantics dictionary for later use IReadOnlyDictionary > semantics = vcResult.SemanticInterpretation.Properties; string voiceCommandName = vcResult.RulePath.First(); if (voiceCommandName == "FindText") { // What did the user say, for named phrase topic or list "slots"? e.g. "Windows Phone Voice Commands" if (semantics.ContainsKey("dictatedSearchTerms")) { HandleFindTextWithSearchTerms(semantics["dictatedSearchTerms"][0]); } else { HandleNoSearchTerms(); } // Else handle other voice commands } navigationHelper.OnNavigatedTo(e) } if (voiceCommandName == "FindText") { // What did the user say, for named phrase topic or list "slots"? // e.g. "Windows Phone Voice Commands" if (semantics.ContainsKey("dictatedSearchTerms")) { HandleFindTextWithSearchTerms(semantics["dictatedSearchTerms"][0]); } else { HandleNoSearchTerms(); }

// Windows Runtime App on Windows Phone 8.1, inside OnNavigatedTo in NlpCommand.xaml.cs protected override void OnNavigatedTo(NavigationEventArgs e) { base.OnNavigatedTo(e); // Get recognition result from parameter passed in frame.Navigate call SpeechRecognitionResult vcResult = e.Parameter as SpeechRecognitionResult; // Check for null! string commandMode = vcResult.SemanticInterpretation.Properties["commandMode"][0]; if (commandMode == "voice") // Did the user speak or type the command? { SpeakText(audioPlayer, String.Format("MSDN app heard you say {0}", vcResult.Text)); HandleNlpCommand(vcResult); } else if(commandMode=="text") { messageTextBox.Text = string.Format("Working on your request \"{0}\"", vcResult.Text); HandleNlpCommand(vcResult); }

// Windows Runtime App on Windows Phone 8.1, inside OnNavigatedTo In NlpCommand.xaml.cs protected override void OnNavigatedTo(NavigationEventArgs e) { base.OnNavigatedTo(e); // Get recognition result from parameter passed in frame.Navigate call SpeechRecognitionResult vcResult = e.Parameter as SpeechRecognitionResult; // Check for null! string commandMode = vcResult.SemanticInterpretation.Properties["commandMode"][0]; if (commandMode == "voice") // Did the user speak or type the command? { SpeakText(audioPlayer, String.Format("MSDN app heard you say {0}", vcResult.Text)); HandleNlpCommand(vcResult); } else if(commandMode=="text") { messageTextBox.Text = string.Format("Working on your request \"{0}\"", vcResult.Text); HandleNlpCommand(vcResult); } // Windows Runtime App on Windows Phone 8.1, in OnNavigatedTo in NlpCommand.xaml.cs protected override void OnNavigatedTo(NavigationEventArgs e) { // Get recognition result from parameter passed in frame.Navigate call SpeechRecognitionResult vcResult = e.Parameter as SpeechRecognitionResult; string commandMode = vcResult.SemanticInterpretation.Properties["commandMode"][0];

// Windows Runtime App on Windows Phone 8.1, inside OnNavigatedTo In NlpCommand.xaml.cs protected override void OnNavigatedTo(NavigationEventArgs e) { base.OnNavigatedTo(e); // Get recognition result from parameter passed in frame.Navigate call SpeechRecognitionResult vcResult = e.Parameter as SpeechRecognitionResult; // Check for null! string commandMode = vcResult.SemanticInterpretation.Properties["commandMode"][0]; if (commandMode == "voice") // Did the user speak or type the command? { SpeakText(audioPlayer, String.Format("MSDN app heard you say {0}", vcResult.Text)); HandleNlpCommand(vcResult); } else if(commandMode=="text") { messageTextBox.Text = string.Format("Working on your request \"{0}\"", vcResult.Text); HandleNlpCommand(vcResult); } string commandMode = vcResult.SemanticInterpretation.Properties["commandMode"][0]; if (commandMode == "voice") // Did the user speak or type the command? { SpeakText(audioPlayer, String.Format("MSDN voice heard you say {0}", vcResult.Text)); HandleNlpCommand(vcResult); } else if(commandMode=="text") { msgTextBox.Text= string.Format("Working on your request \"{0}\"", vcResult.Text); HandleNlpCommand(vcResult); }

private void HandleNlpCommand(string recoText, bool actSilently) { string action = null; string navigateTo = null; string searchFor = null; recoText = recoText.ToLower(); if (recoText.Contains("go to ") || recoText.Contains("goto ") || recoText.Contains("find ") || recoText.Contains("search ") || recoText.Contains("show me ")) { action = "navigate"; if (recoText.Contains("windows phone dev center")) { navigateTo = " } else if (recoText.Contains("learn how to ")) { action = "find"; searchFor = recoText.Substring(recoText.IndexOf("learn how to ") + 13); } else { action = "find"; searchFor = recoText; } switch (action) { case "find": //...

private void HandleNlpCommand(string recoText, bool actSilently) { string action = null; string navigateTo = null; string searchFor = null; recoText = recoText.ToLower(); if (recoText.Contains("go to ") || recoText.Contains("goto ") || recoText.Contains("find ") || recoText.Contains("search ") || recoText.Contains("show me ")) { action = "navigate"; if (recoText.Contains("windows phone dev center")) { navigateTo = " } else if (recoText.Contains("learn how to ")) { action = "find"; searchFor = recoText.Substring(recoText.IndexOf("learn how to ") + 13); } else { action = "find"; searchFor = recoText; } switch (action) { case "find": //... if (recoText.Contains("go to ") || recoText.Contains("goto ") || recoText.Contains("find ") || recoText.Contains("search ") || recoText.Contains("show me ")) { action = "navigate"; if (recoText.Contains("windows phone dev center")) { navigateTo = " }

private void HandleNlpCommand(string recoText, bool actSilently) { string action = null; string navigateTo = null; string searchFor = null; recoText = recoText.ToLower(); if (recoText.Contains("go to ") || recoText.Contains("goto ") || recoText.Contains("find ") || recoText.Contains("search ") || recoText.Contains("show me ")) { action = "navigate"; if (recoText.Contains("windows phone dev center")) { navigateTo = " } else if (recoText.Contains("learn how to ")) { action = "find"; searchFor = recoText.Substring(recoText.IndexOf("learn how to ") + 13); } else { action = "find"; searchFor = recoText; } switch (action) { case "find": //... else if (recoText.Contains("learn how to ")) { action = "find"; searchFor = recoText.Substring(recoText.IndexOf("learn how to ") + 13); }

private void HandleNlpCommand(string recoText, bool actSilently) { string action = null; string navigateTo = null; string searchFor = null; recoText = recoText.ToLower(); if (recoText.Contains("go to ") || recoText.Contains("goto ") || recoText.Contains("find ") || recoText.Contains("search ") || recoText.Contains("show me ")) { action = "navigate"; if (recoText.Contains("windows phone dev center")) { navigateTo = " } else if (recoText.Contains("learn how to ")) { action = "find"; searchFor = recoText.Substring(recoText.IndexOf("learn how to ") + 13); } else { action = "find"; searchFor = recoText; } switch (action) { case "find": //... else { action = "find"; searchFor = recoText; }

// Windows Phone Silverlight App // Synthesis private async void SpeakText(string textToSpeak) { SpeechSynthesizer synthesizer = new SpeechSynthesizer(); await synthesizer.SpeakTextAsync(textToSpeak); } // Recognition private async Task RecognizeSpeech() { SpeechRecognizerUI recognizer = new SpeechRecognizerUI(); // One of three Grammar types available recognizer.Recognizer.Grammars.AddGrammarFromPredefinedType( "key1", SpeechPredefinedGrammar.WebSearch); await recognizer.Recognizer.PreloadGrammarsAsync(); // Optional but recommended // Put up UI and recognize user's utterance SpeechRecognitionUIResult result = await recognizer.RecognizeWithUIAsync(); return result; } // Calling code uses result.RecognitionResult.Text or result.RecognitionResult.Semantics

// Windows Phone Silverlight App // Synthesis private async void SpeakText(string textToSpeak) { SpeechSynthesizer synthesizer = new SpeechSynthesizer(); await synthesizer.SpeakTextAsync(textToSpeak); } // Recognition private async Task RecognizeSpeech() { SpeechRecognizerUI recognizer = new SpeechRecognizerUI(); // One of three Grammar types available recognizer.Recognizer.Grammars.AddGrammarFromPredefinedType( "key1", SpeechPredefinedGrammar.WebSearch); await recognizer.Recognizer.PreloadGrammarsAsync(); // Optional but recommended // Put up UI and recognize user's utterance SpeechRecognitionUIResult result = await recognizer.RecognizeWithUIAsync(); return result; } // Calling code uses result.RecognitionResult.Text or result.RecognitionResult.Semantics // Synthesis private async void SpeakText(string textToSpeak) { SpeechSynthesizer synthesizer = new SpeechSynthesizer(); await synthesizer.SpeakTextAsync(textToSpeak); }

// Windows Phone Silverlight App // Synthesis private async void SpeakText(string textToSpeak) { SpeechSynthesizer synthesizer = new SpeechSynthesizer(); await synthesizer.SpeakTextAsync(textToSpeak); } // Recognition private async Task RecognizeSpeech() { SpeechRecognizerUI recognizer = new SpeechRecognizerUI(); // One of three Grammar types available recognizer.Recognizer.Grammars.AddGrammarFromPredefinedType( "key1", SpeechPredefinedGrammar.WebSearch); await recognizer.Recognizer.PreloadGrammarsAsync(); // Optional but recommended // Put up UI and recognize user's utterance SpeechRecognitionUIResult result = await recognizer.RecognizeWithUIAsync(); return result; } // Calling code uses result.RecognitionResult.Text or result.RecognitionResult.Semantics // Recognition private async Task RecognizeSpeech() { SpeechRecognizerUI recognizer = new SpeechRecognizerUI(); // One of three Grammar types available recognizer.Recognizer.Grammars.AddGrammarFromPredefinedType( "key1", SpeechPredefinedGrammar.WebSearch); // Optional but recommended await recognizer.Recognizer.PreloadGrammarsAsync();

// Windows Phone Silverlight App // Synthesis private async void SpeakText(string textToSpeak) { SpeechSynthesizer synthesizer = new SpeechSynthesizer(); await synthesizer.SpeakTextAsync(textToSpeak); } // Recognition private async Task RecognizeSpeech() { SpeechRecognizerUI recognizer = new SpeechRecognizerUI(); // One of three Grammar types available recognizer.Recognizer.Grammars.AddGrammarFromPredefinedType( "key1", SpeechPredefinedGrammar.WebSearch); await recognizer.Recognizer.PreloadGrammarsAsync(); // Optional but recommended // Put up UI and recognize user's utterance SpeechRecognitionUIResult result = await recognizer.RecognizeWithUIAsync(); return result; } // Calling code uses result.RecognitionResult.Text or result.RecognitionResult.Semantics // Put up UI and recognize user's utterance SpeechRecognitionUIResult result = await recognizer.RecognizeWithUIAsync(); return result;

// Windows Phone Store App // Synthesis // C# code behind // Function to speak a text string private async void SpeakText(MediaElement audioPlayer, string textToSpeak) { SpeechSynthesizer synthesizer = new SpeechSynthesizer(); SpeechSynthesisStream ttsStream = await synthesizer.SynthesizeTextToStreamAsync(textToSpeak); audioPlayer.SetSource(ttsStream, ""); // This starts the player because AutoPlay="True" }

// Windows Phone Store App // Synthesis // C# code behind // Function to speak a text string private async void SpeakText(MediaElement audioPlayer, string textToSpeak) { SpeechSynthesizer synthesizer = new SpeechSynthesizer(); SpeechSynthesisStream ttsStream = await synthesizer.SynthesizeTextToStreamAsync(textToSpeak); audioPlayer.SetSource(ttsStream, ""); // This starts the player because AutoPlay="True" } // Synthesis

// Windows Phone Store App // Synthesis // C# code behind // Function to speak a text string private async void SpeakText(MediaElement audioPlayer, string textToSpeak) { SpeechSynthesizer synthesizer = new SpeechSynthesizer(); SpeechSynthesisStream ttsStream = await synthesizer.SynthesizeTextToStreamAsync(textToSpeak); audioPlayer.SetSource(ttsStream, ""); // This starts the player because AutoPlay="True" } // C# code behind // Function to speak a text string private async void SpeakText(MediaElement audioPlayer, string textToSpeak) { SpeechSynthesizer synthesizer = new SpeechSynthesizer(); SpeechSynthesisStream ttsStream = await synthesizer.SynthesizeTextToStreamAsync(textToSpeak); audioPlayer.SetSource(ttsStream, ""); // This starts the player because AutoPlay="True" }

// Windows Phone Store App // Recognition private async Task RecognizeSpeech() { SpeechRecognizer recognizer = new SpeechRecognizer(); // One of three Constraint types available SpeechRecognitionTopicConstraint topicConstraint = new SpeechRecognitionTopicConstraint(SpeechRecognitionScenario.WebSearch, "MSDN"); recognizer.Constraints.Add(topicConstraint); await recognizer.CompileConstraintsAsync(); // Required // Put up UI and recognize user's utterance SpeechRecognitionResult result = await recognizer.RecognizeWithUIAsync(); return result; } // Calling code uses result.RecognitionResult.Text or // result.RecognitionResult.SemanticInterpretation

// Windows Phone Store App // Recognition private async Task RecognizeSpeech() { SpeechRecognizer recognizer = new SpeechRecognizer(); // One of three Constraint types available SpeechRecognitionTopicConstraint topicConstraint = new SpeechRecognitionTopicConstraint(SpeechRecognitionScenario.WebSearch, "MSDN"); recognizer.Constraints.Add(topicConstraint); await recognizer.CompileConstraintsAsync(); // Required // Put up UI and recognize user's utterance SpeechRecognitionResult result = await recognizer.RecognizeWithUIAsync(); return result; } // Calling code uses result.RecognitionResult.Text or // result.RecognitionResult.SemanticInterpretation SpeechRecognizer recognizer = new SpeechRecognizer(); // One of three Constraint types available SpeechRecognitionTopicConstraint topicConstraint = new SpeechRecognitionTopicConstraint( SpeechRecognitionScenario.WebSearch, "MSDN"); recognizer.Constraints.Add(topicConstraint); await recognizer.CompileConstraintsAsync(); // Required

// Windows Phone Store App // Recognition private async Task RecognizeSpeech() { SpeechRecognizer recognizer = new SpeechRecognizer(); // One of three Constraint types available SpeechRecognitionTopicConstraint topicConstraint = new SpeechRecognitionTopicConstraint(SpeechRecognitionScenario.WebSearch, "MSDN"); recognizer.Constraints.Add(topicConstraint); await recognizer.CompileConstraintsAsync(); // Required // Put up UI and recognize user's utterance SpeechRecognitionResult result = await recognizer.RecognizeWithUIAsync(); return result; } // Calling code uses result.RecognitionResult.Text or // result.RecognitionResult.SemanticInterpretation // Put up UI and recognize user's utterance SpeechRecognitionResult result = await recognizer.RecognizeWithUIAsync(); return result; } // Calling code uses result.RecognitionResult.Text or // result.RecognitionResult.SemanticInterpretation

❶ ❷

❶ ❷ ❸ ❹ ❺ ❻

❶ ❷