Send a suggestion!

We're building a brand new version of the site, and we'd love to hear your ideas

Members

Technology Zones

IBM Learning Center

Articles

Hosted By

MaximumASP

Info

Rated
Read 120,882 times

Contents

Related Categories

Speech Recognition - The Basics

John T Yung

The Basics

Now in the code window of the form with the DirectSR, select DirectSR1 on the top left pull down menu. Pull down the menu to the right of that and you can see the various methods, events and properties the DirectSR component provides. In this article the one DirectSR we will concern ourselves with is the PhraseFinish procedure. This is the procedure that will be called by DirectSR when it has finish processing a voice command.



(Pic. 3) With the Code Window Select DirectSR1 in top left pull down menu and select PhraseFinish in the top right pull down menu.

When you select PhraseFinish, the code that is put in place for you is the following:

Private Sub DirectSR1_PhraseFinish(ByVal flags As Long, _
ByVal beginhi As Long, ByVal beginlo As Long, ByVal endhi As Long, _
ByVal endlo As Long, ByVal Phrase As String, ByVal parsed As String, ByVal results As Long)
'''' End Code

There's a lot of parameters you say. But don't be frightened! We only need to be concerned with the Phrase parameter; this will contain the recognized word that was processed by the DirectSR engine.

Now that we got that set up, we will have to input a set of words for the Speech Engine to recognize. The job is very simple, we just feed in the set of words during the Form's Onload procedure. But how do we do that you ask? Simple, DirectSR have two ways for you to feed the words in, they are DirectSR1.GrammarFromString which takes in a String variable that contains the words and DirectSR1.GrammarFromFile which takes in a file path to a file that contains the words in a text file. Simple enough? The method we will use is DirectSR1.GrammarFromString because this provides the greatest flexibility because you can dynamically add additional words to the engine and still add words in from a file like DirectSR1.GrammarFromFile by putting the text in the file into a variable.

John Yung is a MCSD Visual Basic programmer base in New York. He works for Webadviso Inc and also does consulting work for companies to develop programs in various areas such as ADO, MSXML, Voice Recognition, User interface design and etc. He develops h

Comments

  • Doubt

    Posted by sandeepravi on 01 Aug 2008

    hi i am Sandeep


     I am doing a project on Speech recognition and my code is quite different from this one mentioned here...i would like to know one ...

  • Re: source code

    Posted by indikasira on 02 Jan 2008


    My Friend if u have that voice reconzing cord... can you please kindly send me that cord to me? i'm indika from sri lanka..
    my email address is indikasampath@gmail.com
    thank you very much

  • Re: [1598] Speech Recognition

    Posted by Sadiqq on 31 Mar 2007


    hi...


  • Re: [1598] Speech Recognition

    Posted by bhupi4u on 16 Mar 2007

    sir please tell me how can i use speech recognition engine tool in visual basic express edition 2005

  • Speech Recognition in vb.net plzz help

    Posted by isha_workholic on 14 Apr 2006

    hello sr, i have been writing u from so many days , actually the problem exist becoz i am making the same project in vb.net , witch take diffrent parameters in phrase_finish function


    can u ...