MSSpeech-Forum Homepage
Forum Home Forum Home > Windows™ Speech Recognition Forums > New Users & General Questions
  New Posts New Posts RSS Feed - Action after recognizing a command
  FAQ FAQ  Forum Search   Events   Register Register  Login Login

Action after recognizing a command

 Post Reply Post Reply
Author
Message
Guests View Drop Down
Guest Group
Guest Group
Post Options Post Options   Thanks (0) Thanks(0)   Quote Guests Quote  Post ReplyReply Direct Link To This Post Topic: Action after recognizing a command
    Posted: 04/Mar/2010 at 5:46am

Hi people

i'm new to speech development and i'm learning as i go forward.

i'm developing an application using system.speech namespace with some simple functionality.

i'm using the following method to display what is recognized in a text box, this part works fine:

        void spRecognizer_SpeechRecognized(object sender, SpeechRecognizedEventArgs e)
        {
            textBox2.Text = e.Result.Text;
        }

also, i'm using this method to create a grammar builder to create some grammars (commands)

        private Grammar CreateSampleGrammar()
        {
            Choices commandChoices = new Choices("Wikipedia", "Google", "Yahoo", "MSN");
            GrammarBuilder grammarBuilder = new GrammarBuilder("Search");
            grammarBuilder.Append(commandChoices);
            Grammar g = new Grammar(grammarBuilder);
            g.Name = "Available programs";
            return g;
        }

and when i click on the button, the grammar is loaded:

        private void button3_Click(object sender, EventArgs e)
        {
            SpeechRecognizer spRecognizer = new SpeechRecognizer();
            Grammar g = CreateSampleGrammar();

            spRecognizer.LoadGrammar(g);
        }

i should mention that before i click on this button, when i say , for example: Search Google, in the text box it appears search google ( not all of the time, but most of the times its something similar). but after i click the button, when the grammar is loaded, then, when i say for example search google, on the speech recognition bar ( on the top of screen) it displays "Search Google", but nothing is typed in the text box.

 it seems to me that, the second time when i say "search wikipeda", the engine recognize the phrase as a command, a command like "Open Notepad" (which opens notepad). correct me if i'm wrong...

if that's the case, that's what want, i'd like the application to take an action upon recognizing my command, like when i say "Search Google", with the grammar loaded, google.com should be opened in the system's default web explorer.

 how can i achieve this?

appreciating any help in advance


Ali.B
Back to Top
mmarkoe_admin View Drop Down
Admin Group
Admin Group
Avatar

Joined: 16/Jul/2008
Status: Offline
Points: 331
Post Options Post Options   Thanks (0) Thanks(0)   Quote mmarkoe_admin Quote  Post ReplyReply Direct Link To This Post Posted: 04/Mar/2010 at 10:50am
This forum is for users of WSR, Windows Speech Recognition, built into the Vista and Window 7 operating systems.
 
CLICK HERE for Microsoft Developer Support.
 
Marty Markoe, eMicrophones, Inc.
Back to Top
 Post Reply Post Reply
  Share Topic   

Forum Jump Forum Permissions View Drop Down

Forum Software by Web Wiz Forums® version 12.02
Copyright ©2001-2019 Web Wiz Ltd.

This page was generated in 0.176 seconds.

Microsoft Most Valuable Professional

§- Thank you for visiting our Windows Speech Recognition and Macro Forum.. -§