C# Speech Recognition - Is this what the user said?

后端 未结 11 953
感动是毒
感动是毒 2020-11-28 19:49

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 r

相关标签:
11条回答
  • 2020-11-28 20:02

    Try Microsoft Speech Server, which I think now is part of Office Communication Server 2007. It contains a SR/TTS engines, C# API and tools that integrate with Visual Studio.

    0 讨论(0)
  • 2020-11-28 20:02

    This is the article from MSDN magazine that first discussed using the System.Speech APIs for Vista. Some of it is out of date because the API changed between beta (when the article was written) and the release of Vista, but this is still one of the best resources I've found and covers a good intro to the System.Speech namespace. See http://msdn.microsoft.com/en-us/magazine/cc163663.aspx

    0 讨论(0)
  • 2020-11-28 20:03

    Check out the new Speech class libraries in .NET 3.5

    http://msdn.microsoft.com/en-us/library/system.speech.recognition.speechrecognizer.aspx

    general documentation for SR and TTS

    http://msdn.microsoft.com/en-us/library/system.speech.recognition.aspx http://msdn.microsoft.com/en-us/library/system.speech.synthesis.aspx

    0 讨论(0)
  • 2020-11-28 20:04

    [Note: I was the development lead for the managed speech recognition API in .NET 3.0]

    System.Speech is part of .NET 3.0, so it is available on both Vista and XP. In Vista you have the added benefit of having a speech recognition engine pre-installed by the OS. On XP you choices are: use the SAPI 5.1 SDK with a very old engine (but might work well enough for your command and control scenario), install Office 2003 which installs a newer version of the recognizer. There are a few SAPI 5 complient speech recognition engines available as well.

    If you need to switch languages, you will want to use the System.Speech.Recognition.SpeechRecognitionEngine class which allows you to choose the SR engine for the language you need to support. Note that engines are defined by a set of languages they support (they might be using the same binary, only swapping data files to support additional languages).

    Comment if you need to know more.

    Philipp

    0 讨论(0)
  • 2020-11-28 20:07

    Before this add 'Speech' reference

    System.Speech

    Found that the code example posted by Kyralessa on Oct 22nd didn't work for me but a slightly revised version did. When adding strings into the Choices object use full text English words not numbers. Seems the MS speech recognition engine can't recognize numbers by themselves.

    I have marked these modifications with some commenting added to the previous example.

    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();
    
        // Doens't work must use English words to add to Choices and
        // populate grammar.
        //
        //for (var i = 0; i <= 100; i++)
        //  c.Add(i.ToString());
    
        c.Add("one");
        c.Add("two");
        c.Add("three");
        c.Add("four");
        // etc...
    
        var gb = new GrammarBuilder(c);
        var g = new Grammar(gb);
        rec.LoadGrammar(g);
        rec.Enabled = true;
      }
    
    0 讨论(0)
  • 2020-11-28 20:07

    If the engine is what you're asking about then I've found (beware, I'm just listing, I haven't tried any of them):

    Lumenvox engine

    you also have the SAPI SDK from Microsoft itself, I've only tried it for text to speech but according to its definition:

    The SDK also includes freely distributable text-to-speech (TTS) engines (in U.S. English and Simplified Chinese) and speech recognition (SR) engines (in U.S. English, Simplified Chinese, and Japanese).

    0 讨论(0)
提交回复
热议问题