private async void Listen() { if (!busy) { busy = true; // Initialize the SpeechRecognizerUI object. recoWithUI = new SpeechRecognizerUI(); // Query for a recognizer that recognizes French as spoken in France. IEnumerable<SpeechRecognizerInformation> recognizers = from recognizerInfo in InstalledSpeechRecognizers.All select recognizerInfo; // Set the recognizer to the top entry in the query result. recoWithUI.Recognizer.SetRecognizer(recognizers.ElementAt(0)); // Create a string array of French numbers. string[] settings = (from MarketCat cat in listOfCats.ToList() select cat.Title).ToArray(); // Create a list grammar from the string array and add it to the grammar set. recoWithUI.Recognizer.Grammars.AddGrammarFromList("categories", settings); string listenText = ""; string exampleText = ""; for (int i = 0; i < settings.Length; i++) { listenText += settings[i]; exampleText += " " + settings[i]; } // Display text to prompt the user's input. recoWithUI.Settings.ListenText = "Category Between: "; recoWithUI.Settings.ReadoutEnabled = false; // Give an example of ideal speech input. recoWithUI.Settings.ExampleText = exampleText; // Load the grammar set and start recognition. SpeechRecognitionUIResult recoResult = await recoWithUI.RecognizeWithUIAsync(); string action = recoResult.RecognitionResult.Text; SpeechSynthesizer ss = new SpeechSynthesizer(); VoiceInformation vi = InstalledVoices.All.Where(v => v.Language == "en-EN" && v.Gender == VoiceGender.Male).FirstOrDefault(); ss.SetVoice(vi); await ss.SpeakTextAsync("I'm looking for " + action + "!"); MarketCat chooseCat = (from MarketCat cat in listOfCats.ToList() where cat.Title == action select cat).FirstOrDefault(); chooseAppsPreview = CreateAppsPreview(chooseCat); CategorieTitle.Text = chooseCat.Title; AppsPreviewContent.Children.Clear(); AppsPreviewContent.Children.Add(chooseAppsPreview); chooseAppsPreview.load(); chooseAppsPreview.CompletedEvent+= (e, o) => { sayAppName(); }; } busy = false; }