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<bool> ^ TrySetSystemSpeechLanguageAsync(Language ^ speechLanguage);
 static IAsyncOperation<bool> TrySetSystemSpeechLanguageAsync(Language const & speechLanguage);
[Windows.Foundation.Metadata.RemoteAsync]
public static IAsyncOperation<bool> TrySetSystemSpeechLanguageAsync(Language speechLanguage);
function trySetSystemSpeechLanguageAsync(speechLanguage)
Public Shared Function TrySetSystemSpeechLanguageAsync (speechLanguage As Language) As IAsyncOperation(Of Boolean)

Parameters

speechLanguage
Language

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

Returns

IAsyncOperation<Boolean>

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

Attributes

Windows 10 requirements

Device family
Windows 10 Fall Creators Update (introduced in 10.0.16299.0)
API contract
Windows.Foundation.UniversalApiContract (introduced in v5.0)

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.

Applies to

See also

  • <xref:Windows.Media.SpeechRecognition.SpeechRecognizer.SystemSpeechLanguage%0a-+%5bWindows.Globalization.Language.IsWellFormed%5d(https%3a%2f%2fdocs.microsoft.com%2fuwp%2fapi%2fwindows.globalization.language%23Windows_Globalization_Language_IsWellFormed_System_String_)%0a%0a%23%23%23+How-to%27s%0a-+%5bEmbedded+mode%5d(https%3a%2f%2fdeveloper.microsoft.com%2fwindows%2fiot%2fdocs%2fembeddedmode)%0a-+%5bApp+capability+declarations%5d(https%3a%2f%2fdocs.microsoft.com%2fwindows%2fuwp%2fpackaging%2fapp-capability-declarations)%0a-+%5bSet+speech+recognition+timeouts%5d(https%3a%2f%2fdocs.microsoft.com%2fwindows%2fuwp%2finput-and-devices%2fset-speech-recognition-timeouts)%0a-+%5bSpeech+interactions%5d(https%3a%2f%2fdocs.microsoft.com%2fwindows%2fuwp%2finput-and-devices%2fspeech-interactions)%0a-+%5bSpeech+design+guidelines%5d(https%3a%2f%2fdocs.microsoft.com%2fwindows%2fuwp%2finput-and-devices%2fspeech-interactions)%0a%0a%0a%23%23%23+Samples%0a-+%5bSpeech+recognition+and+speech+synthesis+sample%5d(https%3a%2f%2fgithub.com%2fMicrosoft%2fWindows-universal-samples%2ftree%2fmaster%2fSamples%2fSpeechRecognitionAndSynthesis)>