Share via


SpeechRecognizer.TrySetSystemSpeechLanguageAsync(Language) 方法

定义

异步尝试在 IoT 设备上设置用于语音识别的系统语言。

注意

此方法仅在 嵌入模式下可用。

public:
 static IAsyncOperation<bool> ^ TrySetSystemSpeechLanguageAsync(Language ^ speechLanguage);
/// [Windows.Foundation.Metadata.RemoteAsync]
 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)

参数

speechLanguage
Language

用于语音识别的基于 BCP-47 的系统语言。

返回

如果设置操作成功,则返回 true 的异步操作。 否则,返回 false。

属性

Windows 要求

设备系列
Windows 10 Fall Creators Update (在 10.0.16299.0 中引入)
API contract
Windows.Foundation.UniversalApiContract (在 v5.0 中引入)

注解

应用必须声明 systemManagement 功能,该功能允许应用访问基本的系统管理权限,包括区域设置、时区、关闭和重新启动。

在应用的包清单中声明 systemManagement 功能时,必须包含 iot 命名空间。

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

使用 SystemSpeechLanguage 获取当前的系统语音识别语言。

使用 Windows.Globalization.Language.IsWellFormed 验证 speechLanguage

适用于

另请参阅