How to use Phrase List Grammars for recognising Speech in Windows Phone Apps?

Published on October 3, 2013 by abundantcode

Filed under Windows Phone

Last modified October 3, 2013

Print this page

rate 1 star rate 2 star rate 3 star rate 4 star rate 5 star
Your rating: none, Average: 0 (0 votes)

This article have been viewed 3024 times

The List grammars is one of the grammars that the developers can use to create their own custom grammars. With this technique, simply create an array or collection of strings which are the phrase list and set it to the grammars list of the SpeechRecognizer Object.

How to use Phrase List Grammars for recognizing Speech in Windows Phone Apps?

Below is a code snippet demonstrating How to use Phrase List Grammars via array of strings for recognising Speech in Windows Phone Apps.

async private void Button_Click_1(object sender, RoutedEventArgs e)

{

SpeechRecognizerUI speech = new SpeechRecognizerUI();

string[] days = { "Monday", "Tuesday", "Wednesday", "Thursday", "Friday", "Saturday", "Sunday" };

speech.Recognizer.Grammars.AddGrammarFromList("Days", days);

SpeechRecognitionUIResult result = await speech.RecognizeWithUIAsync();

if (result.ResultStatus == SpeechRecognitionUIStatus.Succeeded)

{

MessageBox.Show(result.RecognitionResult.Text);

}

}
0saves
If you enjoyed this post, please consider leaving a comment or subscribing to the RSS feed to have future articles delivered to your feed reader.

Leave a Comment


x

You might be Interested in these Posts

How to delete user account from command line in Windows 10 ?

You can delete a user account from command line in Windows 10 using the net user command and specify...

How to add new user account from command line in Windows 10 ?

You can add a new user account in Windows 10 using command prompt using the net user command and pas...

How to open display settings from command line in Windows 10 ?

The display properties can be found in the settings app in Windows 10 which lets the users to config...