C# 语音识别

发布于 2024-11-05 13:04:40 字数 111 浏览 2 评论 0 原文

在哪里可以找到 C# 语音识别命名空间的参考资料和完整文档。 MSDN 只提供了对成员的非常简短的描述,我所能找到的没有更多内容。对于这类事情是否有绝对的资源?我学到的大部分内容都来自论坛中的其他教程或片段。

Where can I find references and full documentation for the C# speech recognition namespace. MSDN only provides a very brief description of the members and nothing more from what I can find. Is there an absolute resource for theses kinds of things. Mostly everything I'm learning is from other tutorials or snippets in forums.

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(3

沉鱼一梦 2024-11-12 13:04:40

简介:语音识别

涵盖大部分基础知识的代码示例:

语音入门认可

语音的基本操作
识别应用程序执行:
- 启动语音识别器。

  • 创建识别语法。

  • 将语法加载到语音识别器中。

  • 注册语音识别事件通知。

  • 为语音识别事件创建处理程序。

Intro: Speech Recognition

Code examples covering most of the basics:

Getting Started with Speech Recognition

The basic operations that speech
recognition applications perform:
- Starting the speech recognizer.

  • Creating a recognition grammar.

  • Loading the grammar into a speech recognizer.

  • Registering for speech recognition event notification.

  • Creating a handler for the speech recognition event.

心奴独伤 2024-11-12 13:04:40

我发现关于 .NET 4 的 System.Speech.Recognition 的最新 MSDN 页面在细节上很少,但 .NET 3.5 的旧页面有更多细节。为了快速比较,我刚刚抓住了这两页:

  • RecognitionResult 类 - .NET 4.0 - <一href="http://msdn.microsoft.com/en-us/library/system.speech.recognition.recognitionresult(v=VS.100).aspx" rel="nofollow">http://msdn.microsoft. com/en-us/library/system.speech.recognition.recognitionresult(v=VS.100).aspx

.NET 3.5 文档详细介绍了评论和例子。 .NET 4.0 版本只有定义。

我发现服务器语音平台 SDK 附带的帮助文件包含 .NET 4.0 MSDN 页面遗漏的详细信息 - http://www.microsoft.com/downloads/en/details.aspx?FamilyID=1b1604d3-4f66-4241-9a21-90a294a5c9a4

要开始使用 .NET 语音,有一篇几年前发表的非常好的文章,网址为 http://msdn.microsoft.com/en-us/magazine/cc163663.aspx。这可能是迄今为止我发现的最好的介绍性文章。它有点过时,但非常有帮助。 (AppendResultKeyValue 方法在测试版和可能的其他重大更改之后被删除。)

I found that the latest MSDN pages on System.Speech.Recognition for .NET 4 are skimpy on the details, but the older pages for .NET 3.5 have more details. For a quick comparison I just grabbed these two pages:

vs.

The .NET 3.5 docs have detailed remarks and examples. The .NET 4.0 versions just have definitions.

I found the helpfile that comes with the Server Speech Platform SDK has details that the .NET 4.0 MSDN pages leave off - http://www.microsoft.com/downloads/en/details.aspx?FamilyID=1b1604d3-4f66-4241-9a21-90a294a5c9a4.

To get started with .NET speech, there is a very good article that was published a few years ago at http://msdn.microsoft.com/en-us/magazine/cc163663.aspx. It is probably the best introductory article I’ve found so far. It is a little out of date, but very helfpul. (The AppendResultKeyValue method was dropped after the beta and likely other breaking changes.)

假装爱人 2024-11-12 13:04:40

首先,添加语音识别库。

using System.Speech.Recognition

如果无法加载库,可以使用添加引用来添加。

项目>添加引用>浏览

一般来说,System.Speech.dll位于 C:\Program Files\Reference Assemblies\Microsoft\Framework\v3.0

这里,识别“Yes”的示例代码,”无”、“入”、“出”如下:

namespace SpeechRecognition
{
    public partial class Form1 : Form
    {
        public Form1()
        {
            InitializeComponent();
        }

        private void Form1_Load(object sender, EventArgs e)
        {
            SpeechRecognizer sr = new SpeechRecognizer();
            Choices ch = new Choices();
            ch.Add(new string[] { "yes", "no","in","out" });

            GrammarBuilder gb = new GrammarBuilder();
            gb.Append(ch);

            Grammar gr = new Grammar(gb);

            sr.LoadGrammar(gr);

            sr.SpeechRecognized += new EventHandler<SpeechRecognizedEventArgs>(sr_SpeechRecognition);

        }

        private void sr_SpeechRecognition(object sender, SpeechRecognizedEventArgs e)
        {
            MessageBox.Show(e.Result.Text);

        }
    }
}

Firstly, you add the library for Speech Recognition.

using System.Speech.Recognition

If you cannot load the library, you can add it by using add reference.
Go

Project>Add Reference>Browse

Generally, System.Speech.dll is in C:\Program Files\Reference Assemblies\Microsoft\Framework\v3.0

Here, the example code that recognizes "Yes","No","In","Out" is below:

namespace SpeechRecognition
{
    public partial class Form1 : Form
    {
        public Form1()
        {
            InitializeComponent();
        }

        private void Form1_Load(object sender, EventArgs e)
        {
            SpeechRecognizer sr = new SpeechRecognizer();
            Choices ch = new Choices();
            ch.Add(new string[] { "yes", "no","in","out" });

            GrammarBuilder gb = new GrammarBuilder();
            gb.Append(ch);

            Grammar gr = new Grammar(gb);

            sr.LoadGrammar(gr);

            sr.SpeechRecognized += new EventHandler<SpeechRecognizedEventArgs>(sr_SpeechRecognition);

        }

        private void sr_SpeechRecognition(object sender, SpeechRecognizedEventArgs e)
        {
            MessageBox.Show(e.Result.Text);

        }
    }
}
~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文