C#语音识别 - 这是用户说了什么? [英] C# Speech Recognition - Is this what the user said?

查看:162
本文介绍了C#语音识别 - 这是用户说了什么?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我需要编写它使用一个语音识别引擎的应用程序 - 无论是内置在Vista之一,或第三者 - 一根可以显示一个词或短语,并且当用户读取它识别(或它的近似值)。我还需要能够语言之间快速切换,在不改变操作系统的语言

I have need to write an application which uses a speech recognition engine -- either the built in vista one, or a third party one -- that can display a word or phrase, and recognise when the user reads it (or an approximation of it). I also need to be able to switch quickly between languages, without changing the language of the operating system.

该用户将使用该系统很短的时间。该应用程序需要先不训练的识别引擎到用户的声音的要求工作。

The users will be using the system for very short periods. The application needs to work without the requirement of first training the recognition engine to the users' voices.

这也将是非常美妙的,如果这可以在Windows XP或更小版本的Windows Vista的工作。

It would also be fantastic if this could work on Windows XP or lesser versions of Windows Vista.

任选地,该系统需要能够读取在屏幕上的信息返回给用户,在用户的选择的语言。我可以解决这个规范使用pre-录制画外音,但是preferred的方法是使用文本到语音引擎。

Optionally, the system needs to be able to read information on the screen back to the user, in the user's selected language. I can work around this specification using pre-recorded voice-overs, but the preferred method would be to use a text-to-speech engine.

谁能推荐我的东西?

推荐答案

一个类似的问题,有人问乔尔的软件而回。您可以使用System.Speech.Recognition命名空间做到这一点...有一些限制。添加System.Speech(应在GAC)到您的项目。下面是一些示例code的WinForms应用程序:

A similar question was asked on Joel on Software a while back. You can use the System.Speech.Recognition namespace to do this...with some limitations. Add System.Speech (should be in the GAC) to your project. Here's some sample code for a WinForms app:

public partial class Form1 : Form
{
  SpeechRecognizer rec = new SpeechRecognizer();

  public Form1()
  {
    InitializeComponent();
    rec.SpeechRecognized += rec_SpeechRecognized;
  }

  void rec_SpeechRecognized(object sender, SpeechRecognizedEventArgs e)
  {
    lblLetter.Text = e.Result.Text;
  }

  void Form1_Load(object sender, EventArgs e)
  {
    var c = new Choices();
    for (var i = 0; i <= 100; i++)
      c.Add(i.ToString());
    var gb = new GrammarBuilder(c);
    var g = new Grammar(gb);
    rec.LoadGrammar(g);
    rec.Enabled = true;
  }

此识别从1到100的数字,并显示在表格上所得到的数量。你需要有一个名为lblLetter标签上它的形式。

This recognizes the numbers from 1 to 100, and displays the resulting number on the form. You'll need a form with a label called lblLetter on it.

System.Speech只能使用单词或短语的pre定义的列表;它不是完全NaturallySpeaking,无论是在多功能或认可的质量。但你不必把它训练到用户的声音,如果你只有几个不同的东西,用户可以说,它的工作原理相当不错。而且它是免费的! (如果你有Visual Studio中)

System.Speech only works with a pre-defined list of words or phrases; it's not exactly NaturallySpeaking, either in versatility or in recognition quality. But you don't have to train it to the user's voice, and if you only have a few different things the user can say, it works reasonably well. And it's free! (if you have Visual Studio)

如果你用很短的短语它将无法正常工作;我做了一个计划,我的孩子说英文字母看看他们在屏幕上,但它并没有把它做好,因为许多信件声音相似的(特别是从一个四十岁的口)。

It won't work well if you use very short phrases; I made a program for my kid to say letters of the alphabet and see them on-screen, but it doesn't do that well since many of the letters sound alike (especially from the mouth of a four-year-old).

至于更灵活的选择...好,有上述NaturallySpeaking,其中有一个SDK。但是你要联系销售获得任何形式的访问它,而没有定价上市,所以它要像那些一需要多少费用?嗯,你有多少了?样的事情。似乎没有成为一个下载并播放与它周围选项。 (

As for more flexible options...well, there's the aforementioned NaturallySpeaking, which has an SDK. But you have to contact sales to get any sort of access to it, and no pricing is listed, so it comes across as one of those "How much does it cost? Well, how much have you got?" kind of things. There doesn't seem to be a "download and play around with it" option. :(

至于文本到语音,<一href=\"http://msdn.microsoft.com/en-us/library/system.speech.synthesis.aspx\">System.Speech.Synthesis做这个。它比语音识别更容易。我写了一个小程序,让我打,敲回车,并朗读课文。我4岁的得到由它迷住了。 :)(爸爸,我想TAWK哒wobot。)

As for text-to-speech, System.Speech.Synthesis does this. It's even easier than the speech recognition. I wrote a small program to let me type, hit Enter, and read the text aloud. My four-year-old gets mesmerized by it. :) ("Daddy, I wanna tawk to da wobot.")

这篇关于C#语音识别 - 这是用户说了什么?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆