我在听写模式下使用 SpeechClient.dll 进行语音识别。即使我只是从 SpeechRecognitionServiceFactory 类创建一个对象,它也会给我 XamlParseException
using System;
using MicrosoftProjectOxford;
using System.Configuration;
using System.Diagnostics;
using System.IO;
namespace OnlineRecognition
{
public partial class MainWindow : Window
{
string m_primaryOrSecondaryKey = ConfigurationManager.AppSettings["primaryKey"];
private SpeechRecognitionMode m_recoMode = SpeechRecognitionMode.LongDictation;
private bool m_isMicrophoneReco = true;
private MicrophoneRecognitionClient m_micClient;
/// <summary>
/// Initializes a new instance of the <see cref="MainWindow"/> class.
/// </summary>
public MainWindow()
{
InitializeComponent();
m_micClient = SpeechRecognitionServiceFactory.CreateMicrophoneClient(m_recoMode, "en-us",
m_primaryOrSecondaryKey);
}
}
}
我在几个 msdn 博客中搜索了这个错误,并得到了一个有确切错误的页面
有人建议在 windows 8 中运行代码,因为 windows 语音库对 windows 8 的网络堆栈有硬依赖。我在 Windows 8 上跟踪并执行了代码,但同样的错误仍然存在。谁能帮我解决这个错误。附加了 Win7 和 Win8 上 XamlParseException 详细信息的快照。