本文介绍了如何使用语音识别绘制形状?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

大家好...

我正在研究WINDOWS FORMS,C#

抱歉打扰你,但我必须显示我正在进行语音识别的项目我实际上想要绘制一个形状(内置C#就像圆圈),当用户要求制作它时,任何人都可以告诉我连接两个逻辑的语法,

1;承认演讲

2;画圆圈



我所制作的编码模块是,



用于语音识别




hello everyone...
i am working on "WINDOWS FORMS, C#"
sorry to bother you, but i have to display my project in which i am working on "speech recognition" i actually want to draw a shape (in built in C# like circle), when a user asks to make it, can anyone tell me the syntax to connect the two logics,
1; recognize speech
2; draw circle

the coding modules i have made are,

FOR SPEECH RECOGNITION


using System.Speech.AudioFormat;
    using System.Speech;


    namespace speechexampl
{
        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;

          }





绘图对象





FOR DRAWING OBJECTS

Pen myPen2 = new Pen(System.Drawing.Color.Red, 3);
            Rectangle myRectangle2 = new Rectangle(95, 130, 100, 100);
            graphicsObj.DrawEllipse(myPen2, myRectangle2);

推荐答案



这篇关于如何使用语音识别绘制形状?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

08-20 09:37
查看更多