【问题标题】:PlatformNotSupportedException while using Microsoft System.Speech.Recognition使用 Microsoft System.Speech.Recognition 时出现 PlatformNotSupportedException
【发布时间】:2023-03-08 13:19:01
【问题描述】:

我的程序有一个问题。我想将语音转换为文本,我有这样的代码:

Choices sList = new Choices();
sList.Add(new string[] { "hello" });
Grammar gr = new Grammar(new GrammarBuilder(sList));
try {
    sRecognize.RequestRecognizerUpdate();
    sRecognize.LoadGrammar(gr);
    sRecognize.SpeechRecognized += sRecognize_SpeechRecognized;
    sRecognize.SetInputToDefaultAudioDevice();
    sRecognize.RecognizeAsync(RecognizeMode.Multiple);
    sRecognize.Recognize();
}
catch (Exception ex) {
    MessageBox.Show(ex.Message.ToString());
}

但是当我使用它时,Visual Studio 会给出一个异常“platformnotsupportedexception”并说“没有安装识别器”。我有一个麦克风,但我不知道为什么这不起作用。请帮帮我。

【问题讨论】:

标签: c# .net speech-recognition text-to-speech


【解决方案1】:

platformnotsupportedexception 功能不在特定平台上运行时引发的异常。这意味着您可能没有安装 Microsoft Speech Platform SDK 11 要求和安装。在这里找到:http://msdn.microsoft.com/en-us/library/hh362873.aspx

【讨论】:

  • Speech Platform Runtime 11 和 Speech Platform SDK 11 已安装,但问题未解决
  • 你是用 32bit sdk 构建 64bit 还是其他?
  • 我有一个 64 位并安装 x64
【解决方案2】:

您使用的是 System.Speech.Recognition 还是 Microsoft.Speech.Recognition? They're different。如果您使用的是 Speech Platform Runtime/SDK 11,那么您需要使用 Microsoft.Speech.Recognition。

另外,您可能需要指定cultureinfo when creating your recognizer

【讨论】:

  • 使用 System.Speech.Recognition;
  • 还有一些额外的框架或库可用于实现语音转文本?
  • @user2800980 - 您提到了 Speech Platform Runtime 11 和 Speech Platform SDK 11 - 这些是需要使用 Microsoft.Speech.Recognition 的服务器识别器。
  • 微软。没有发言权
  • @user2800980 - 我不明白你的意思。
猜你喜欢
  • 2018-06-19
  • 2016-02-28
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
相关资源
最近更新 更多