当前位置: 代码迷 >> Windows Mobile >> 有关语音识别的有关问题Exception from HRESULT: 0x800455BC
  详细解决方案

有关语音识别的有关问题Exception from HRESULT: 0x800455BC

热度:326   发布时间:2016-04-25 07:15:08.0
有关语音识别的问题Exception from HRESULT: 0x800455BC
                                string smsText = string.Empty;
                                SpeechRecognizerUI recognizer = new SpeechRecognizerUI();
                                IAsyncOperation<SpeechRecognitionUIResult> recoOperation;
                                IEnumerable<SpeechRecognizerInformation> chineseRecognizers = from recognizerInfo in InstalledSpeechRecognizers.All
                                                                                              where recognizerInfo.Language =="zh-CN"
                                                                                              select recognizerInfo;
                                recognizer.Recognizer.SetRecognizer(chineseRecognizers.ElementAt(0));
                                //recognizer.Recognizer.Grammars.AddGrammarFromPredefinedType("dictation", SpeechPredefinedGrammar.Dictation);
                                await voice.SpeakTextAsync("请说出短信内容");
                                try
                                {
                                    recoOperation = recognizer.RecognizeWithUIAsync();
                                    var recoResult = await recoOperation;
                                    if ((int)recoResult.RecognitionResult.TextConfidence < (int)SpeechRecognitionConfidence.Medium)
                                    {
                                        await voice.SpeakTextAsync("说话声音太小");
                                        return;
                                    }
                                    else 
                                    {
                                        smsText = recoResult.RecognitionResult.Text;
  相关解决方案