DRAG DROP
You are developing a Universal Windows Platform (UWP) app.
You need to ensure that the app can respond to speech.
How should you complete the code? To answer, drag the appropriate code elements to the correct targets. Each element may be used once, more than once, or not
at all. You may need to drag the split bar between panes or scroll to view content.
Select and Place:
Explanation:
Similar example:
private async void StartRecognizing_Click(object sender, RoutedEventArgs e)
{
// Create an instance of SpeechRecognizer.
var speechRecognizer = new Windows.Media.SpeechRecognition.SpeechRecognizer();
// Compile the dictation grammar by default.
await speechRecognizer.CompileConstraintsAsync();
// Start recognition.
Windows.Media.SpeechRecognition.SpeechRecognitionResult speechRecognitionResult = await speechRecognizer.RecognizeWithUIAsync();// Do something with the recognition result.
var messageDialog = new Windows.UI.Popups.MessageDialog(speechRecognitionResult.Text, “Text spoken”);
await messageDialog.ShowAsync();
}https://msdn.microsoft.com/en-us/library/windows/apps/mt185615.aspx
Since “App1 play my music” and “App1 play music” should work, the correct content of the ListenFor element is “play [my] music” instead of “play my music”.
“Use brackets around a word or words that are optional. That is, the word or words can be spoken, but are not necessary for a match. For example, [Show] {options}.”
From: https://docs.microsoft.com/en-us/uwp/schemas/voicecommands/voice-command-elements-and-attributes-1-2