How to Set Different Language for the Speech recognizer in Windows Phone 8 App?

In this blog post, we will see how to set different language for the speech recognizer in Windows Phone 8 App.

When a new instance of the SpeechRecognizerUI is created, the Speech API will load the recognizer for the language that is set by the user in the Settings-> Speech App on the Windows Phone.

How to Set Different Language for the Speech recognizer in Windows Phone 8 App?
How to Set Different Language for the Speech recognizer in Windows Phone 8 App?

The developer can also specify the supported language for the SpeechRecognizer to load. In this blog post, we will look in to the API support on how to achieve this.

How to Set Different Language for the Speech recognizer in Windows Phone 8 App?

The SpeechRecognizerUI exposes the property “Recognizer” which includes the method SetRecognizer which can be used to set the language.

async private void Button_Click_1(object sender, RoutedEventArgs e)

{

var Language = (from language in InstalledSpeechRecognizers.All

where language.Language == "de-DE"

select language).FirstOrDefault();

SpeechRecognizerUI speech = new SpeechRecognizerUI();

speech.Recognizer.SetRecognizer(Language);

await speech.RecognizeWithUIAsync();

}

For example, assume that you want to set the “German” language for the speech recognizer, simply get the SpeechRecognizerInformation from the InstalledSpeechRecognizers.All by using LINQ query filtered by the language “de-DE” and assign it to the Recognizer.SetRecognizer method of the SpeechRecognizerUI object. When you run the project and try the speech feature, you should see the speech recognizer with the German language.

How to Set Different Language for the Speech recognizer in Windows Phone 8 App?
How to Set Different Language for the Speech recognizer in Windows Phone 8 App?

Leave A Reply

Your email address will not be published. Required fields are marked *

You May Also Like

In this post, you’ll learn about the Win32 Error “0x000019E5 – ERROR_COULD_NOT_RESIZE_LOG” that you get when debugging system erors in...
In this post, you’ll learn about the error “CO_E_DBERROR 0x8004E02B” that is returned when working with COM based APIs or...
In this post, you’ll learn about the Win32 Error “0x000019D0 – ERROR_LOG_BLOCK_VERSION” that you get when debugging system erors in...