如何在Windows Phone 8应用程序中进行语音识别服务

编程入门 行业动态 更新时间:2024-10-07 08:28:04
本文介绍了如何在Windows Phone 8应用程序中进行语音识别服务的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧! 问题描述

我正在开发语音识别应用。如何以编程方式检查语音识别服务是启用还是禁用。请检查下面的代码并让我知道解决方案。

I am developing speech recognition app. How can i check programmatically whether the speech recognition service enable or disable. Please check below code and let me know the solution.

var _englishRecognizer = InstalledSpeechRecognizers.All.FirstOrDefault(d => d.Language.ToUpper()==" EN-US"); var speechRecognition = new SpeechRecognizer(); speechRecognition.SetRecognizer(_englishRecognizer); speechRecognition.Settings.EndSilenceTimeout = TimeSpan.FromSeconds(1.2); var recoResult = await speechRecognition.RecognizeAsync(); if(recoResult.TextConfidence == SpeechRecognitionConfidence.High || recoResult.TextConfidence == SpeechRecognitionConfidence.Medium || recoResult。正文!= null) {

var _englishRecognizer = InstalledSpeechRecognizers.All.FirstOrDefault(d => d.Language.ToUpper() == "EN-US"); var speechRecognition = new SpeechRecognizer(); speechRecognition.SetRecognizer(_englishRecognizer); speechRecognition.Settings.EndSilenceTimeout = TimeSpan.FromSeconds(1.2); var recoResult = await speechRecognition.RecognizeAsync(); if (recoResult.TextConfidence == SpeechRecognitionConfidence.High || recoResult.TextConfidence == SpeechRecognitionConfidence.Medium || recoResult.Text != null) {

}

}

Sudhanthira

Sudhanthira

推荐答案

如果您向清单添加ID_CAP_SPEECH_RECOGNITION,则该应用将不会安装在没有该功能的手机上。

If you add ID_CAP_SPEECH_RECOGNITION to the manifest the app will not install on phones that do not have that capability.

这就是你所追求的吗?

之后如果你打电话给服务但它关闭它会提示转动它on:

After that if you call the service and it is off it will prompt to turn it on:

等待YOURRECOGNIZER.RecognizeWithUIAsync();

await YOURRECOGNIZER.RecognizeWithUIAsync();

可以测试返回值以查看它们是否已拒绝:

the return value can be tested to see if they declined:

Windows.Phone.Speech.Recognition.SpeechRecognitionUIResult   ; RecognitionResult null Windows.Phone.Speech.Recognition.SpeechRecognitionResult ResultStatus PrivacyPolicyDeclined

Windows.Phone.Speech.Recognition.SpeechRecognitionUIResult RecognitionResultnullWindows.Phone.Speech.Recognition.SpeechRecognitionResult ResultStatusPrivacyPolicyDeclined

更多推荐

如何在Windows Phone 8应用程序中进行语音识别服务

本文发布于:2023-11-23 06:59:16,感谢您对本站的认可!
本文链接:https://www.elefans.com/category/jswz/34/1620531.html
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
本文标签:应用程序   语音识别   如何在   Phone   Windows

发布评论

评论列表 (有 0 条评论)
草根站长

>www.elefans.com

编程频道|电子爱好者 - 技术资讯及电子产品介绍!