【发布时间】:2019-02-18 23:37:09
【问题描述】:
我正在学习语音识别。我正在使用 System.Speech
这是代码:
var currentCulture = (from r in SpeechRecognitionEngine.InstalledRecognizers()
where r.Culture.Equals(Thread.CurrentThread.CurrentCulture)
select r.Culture).FirstOrDefault();
recognizer = new SpeechRecognitionEngine(currentCulture);
我得到 currentCulture 等于 null,因为在调试中我得到 SpeechRecognitionEngine.InstalledRecognizers().Count 等于 0。
我发现了这个问题: SpeechRecognitionEngine.InstalledRecognizers returns No recognizer installed
他说他使用 Microsoft.Speech 而不是 System.Speech 解决了问题。
我在 Reference->add reference->assembly 中搜索,没有找到 Microsoft.Speech。 试过 Nuget 包管理器搜索 Microsoft.Speech,但没有找到。
谷歌搜索我找到了安装 Microsoft.Speech 的 MSI 包: https://www.microsoft.com/en-us/download/details.aspx?id=27225
重启我的机器,我还是在Reference->add reference->assembly中搜索,没有找到Microsoft.Speech。
现在我的疑问是:
- System.Speech 与 Microsoft.Speech 的差异
- 如何为 System.Speech 安装识别器,如果它更合适的话。
- 如何添加对 Microsoft.Speech 的引用
- 如何使用Microsoft.Speech,如果更合适,可能要使用的代码是
不同。
【问题讨论】:
-
如果你想从 System.Speech 获得意大利语,那么你必须buy the voice。您需要了解的有关 Microsoft.Speech 的所有信息都在下载详细信息中。关键是它只在服务器机器上运行,你需要的SDK是单独下载的。
标签: c# speech-recognition