SpeechRecognizer.TrySetSystemSpeechLanguageAsync(Language) SpeechRecognizer.TrySetSystemSpeechLanguageAsync(Language) SpeechRecognizer.TrySetSystemSpeechLanguageAsync(Language) SpeechRecognizer.TrySetSystemSpeechLanguageAsync(Language) SpeechRecognizer.TrySetSystemSpeechLanguageAsync(Language) Method

Definition

Asynchronously attempts to set the system language used for speech recognition on an IoT device.

Note

This method is available only in Embedded mode.

public : static IAsyncOperation<Platform::Boolean> TrySetSystemSpeechLanguageAsync(Language speechLanguage)
static IAsyncOperation<bool> TrySetSystemSpeechLanguageAsync(Language speechLanguage) const;
public static IAsyncOperation<bool> TrySetSystemSpeechLanguageAsync(Language speechLanguage)
Public Shared Function TrySetSystemSpeechLanguageAsync(speechLanguage As Language) As IAsyncOperation(Of bool)
Windows.Media.SpeechRecognition.SpeechRecognizer.trySetSystemSpeechLanguageAsync(speechLanguage).done( /* Your success and error handlers */ );

Parameters

speechLanguage
Language Language Language

The BCP-47-based system language used for speech recognition.

Returns

An asynchronous operation that returns true if the set operation was a success. Otherwise, returns false.

Additional features and requirements

Device family
Windows 10 Fall Creators Update (introduced v10.0.16299.0)
API contract
Windows.Foundation.UniversalApiContract (introduced v5)

Remarks

Your app must declare the systemManagement capability, which lets apps access basic system administration privileges including locale, timezone, shut down, and reboot.

The systemManagement capability must include the iot namespace when you declare it in your app's package manifest.

<Capabilities><iot:Capability Name="systemManagement"/></Capabilities>

Use SystemSpeechLanguage to get the current system speech recognition language.

Use Windows.Globalization.Language.IsWellFormed to validate speechLanguage.

See also

  • P:Windows.Media.SpeechRecognition.SpeechRecognizer.SystemSpeechLanguage - [Windows.Globalization.Language.IsWellFormed](https://docs.microsoft.com/uwp/api/windows.globalization.language#Windows_Globalization_Language_IsWellFormed_System_String_) ### How-to's - [Embedded mode](https://developer.microsoft.com/windows/iot/docs/embeddedmode) - [App capability declarations](https://docs.microsoft.com/windows/uwp/packaging/app-capability-declarations) - [Set speech recognition timeouts](https://msdn.microsoft.com/library/58f446ac-4a56-454d-8125-62a2c4dbfcc8) - [Speech interactions](https://msdn.microsoft.com/library/646db3ce-fa81-4727-8c21-936c81079439) - [Speech design guidelines](https://msdn.microsoft.com/library/4a63a8c4-4182-4e36-ba12-4c343a56fca9) ### Samples - [Speech recognition and speech synthesis sample](https://go.microsoft.com/fwlink/p/?LinkID=619897)