Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7181301
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 28, 20262026-05-28T17:31:44+00:00 2026-05-28T17:31:44+00:00

I am having trouble in writing a code in my speech recognition engine. The

  • 0

I am having trouble in writing a code in my speech recognition engine.
The task is, when the user says ‘circle’, the engine should automatically draw a circle on the form:

if(Speech == circle)
{
    DrawCircle();
}

The code I’m using for speech recognition is…

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;

         }
     }
}

//**

//> and to draw circle or rectangle:

//**

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

I don’t know how to merge the above code to execute a circle when said so. Any related answer would be a great help!

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-28T17:31:46+00:00Added an answer on May 28, 2026 at 5:31 pm

    e.Result.Text will give you what the person said. So if you want to draw a circle when they say "circle":

    if (e.Result.Text == "circle") {
        //Draw a cricle
    }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm writing some code in python and I'm having trouble when trying to retrieve
I am having trouble writing C++ code that uses a header file designed for
So, I am writing some OpenCV C++ code and I am having trouble porting
Im having trouble with writing coloumn names using a FlexTable in GWT my code
I'm having some trouble writing a query using variables. Here's my code Dim bondnumber
I am having trouble writing to my XML file Here is my code: path
I'm having trouble in writing mutable dictionary to a file. Here's the code that
I am having trouble writing some Java code, which will create a container/folder in
I'm writing some Cocoa code and having trouble with the iTunes track persistent IDs
I'm having trouble writing a query. I have a support tabled called 'MYTABLE' and

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.