在托管代码中使用语音识别 [英] Using Speech Recogntion in managed code

查看:87
本文介绍了在托管代码中使用语音识别的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想在使用C#的托管代码中使用语音识别.我做到了,但我不知道如何将输入源从麦克风"更改为文件或在线流.

I want to use Speech recognition in managed code using C#. I did it but I do not know how I can change the input source  from Microphone to file or online streaming.

> 如果有人可以在这个主题上指导我,我将不胜感激.

I’ll appreciate if anyone can guide me in this topic.

下面是我为非语法语音识别编写的代码,从标准输入设备(麦克风)获取输入.

Below is the code that I wrote for non-grammar speech recognition which take the input from the standard input device (microphone).

public partial   Form1  :  Form
    {
        专用  SpeechRecognizer   ; spRecognizer;
   
        public   Form1()
        {
            InitializeComponent();
       }
私有  void button1_Click(对象发​​件人,  EventArgs   e)
        {
           
          spRecognizer.EmulateRecognize(此"即是; );
               b        }
私有  void Form1_Load(对象 发送者,  EventArgs   e)
        {
           spRecognizer  =  new   语音识别器();
           spRecognizer.Enabled  ==  true ;
           
           spRecognizer.SpeechRecognized  + =  news span style ="color:#2b91af"> EventHandler < SpeechRecognizedEventArgs >(spRecognizer_SpeechRecognized);
       }
void   spRecognizer_SpeechRecognized( object  发件人,语音识别的事件参数  e)
        {
           SpeechViewertb.Text  =  =  e.Result.Text;
       }

public partial class Form1 : Form
    {
        private SpeechRecognizer spRecognizer;
    
        public Form1()
        {
            InitializeComponent();
        }
 
        private void button1_Click(object sender, EventArgs e)
        {
            
            spRecognizer.EmulateRecognize("this is the first trial");
                      
        }
 
        private void Form1_Load(object sender, EventArgs e)
        {
            spRecognizer = new SpeechRecognizer();
            spRecognizer.Enabled = true;
           
            spRecognizer.SpeechRecognized += new EventHandler<SpeechRecognizedEventArgs>(spRecognizer_SpeechRecognized);
        }
 
        void spRecognizer_SpeechRecognized(object sender, SpeechRecognizedEventArgs e)
        {
            SpeechViewertb.Text = e.Result.Text;
        }

> 推荐答案

你好

       谢谢您的发帖!我建议您以( Visual C#开发人员中心 > Visual C#论坛 > Visual C#IDE )位于此处: http://social.msdn.microsoft.com/Forums/en/csharpide/threads

         Thank you for your post!  I would suggest posting your question in one of the (Visual C# Developer Center > Visual C# Forums > Visual C# IDE ) located here: http://social.msdn.microsoft.com/Forums/en/csharpide/threads

      希望对您有帮助.
 
     祝你有美好的一天!

        Hope this helps you.
 
       Have a great day!


这篇关于在托管代码中使用语音识别的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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