Windows Phone 8 语音识别异常

本文关键字:异常 语音识别 Phone Windows | 更新日期: 2023-09-27 18:31:18

我正在开发Windows Phone 8应用程序。我在语音识别方面遇到问题。这是我的代码。

SpeechRecognizerUI recoWithUI= new SpeechRecognizerUI();
try
{
    this.recoWithUI = new SpeechRecognizerUI();
    // Start recognition (load the dictation grammar by default).
    SpeechRecognitionUIResult recoResult = await recoWithUI.RecognizeWithUIAsync();
    // Do something with the recognition result.
    MessageBox.Show(string.Format("You said {0}.", recoResult.RecognitionResult.Text));
}
catch (Exception)
{
    throw;
}

每次我运行它时,它都会转到 App.xaml.cs 类并指出这个问题

private void Application_UnhandledException(object sender, ApplicationUnhandledExceptionEventArgs e)
{
    if (Debugger.IsAttached)
    {
        // An unhandled exception has occurred; break into the debugger
        Debugger.Break(); // It focuses on this line.
    }
}

你知道如何解决这个问题吗?谢谢

Windows Phone 8 语音识别异常

好的,

所以我遇到了问题一切都很好。代码没有问题问题是语音识别器UI类语言是en-Us,但我的手机语言是en-UK,所以我所做的是只需将我的手机语言更改为en-Us,现在它就可以工作了。谢谢

您是否在 WMAppManifest.xml 文件中启用了麦克风功能?

打开 WMApp 清单.xml>"功能"选项卡>检查ID_CAP_MICROPHONE。