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,938 times

Contents

Related Categories

Speech Recognition - And more code...

John T Yung

And more code...

To declare the API put the following code at top of the form code.

Option Explicit

Private Declare Function ShellExecute Lib "shell32.dll" _
Alias "ShellExecuteA" (ByVal hwnd As Long, ByVal _
lpOperation As String, ByVal lpFile As String, ByVal _
lpParameters As String, ByVal lpDirectory As String, _
ByVal nShowCmd As Long) As Long

The core of the sample is basically done, however, as you know, nothing is really done without some style with the GUI. Here is the plan, lets put a button on the form to stop the recognition engine and also to start the engine when its stopped. Also, lets put a label to show the status of the engine and the recognized word.

Place a label on the form. Next place a buttom on the form. Set it's caption property to Enable and then double click on the button to open the code. Place the following code inside:

Private Sub Command1_Click()
    Select Case Command1.Caption
    Case "Disable"
        DirectSR1.Deactivate
        Command1.Caption = "Enable"
        Label1 = "Disabled"
    Case "Enable"
        DirectSR1.Activate
        Command1.Caption = "Disable"
        Label1 = "Ready"
    End Select
End Sub

The code is straight forward. A select case to test the caption of the button. If Disable, Deactivate engine, set button caption to "Enable" and set the label caption to "Disabled". If Enable, Activate engine, set button caption to "Disable" and set the label caption to "Ready". Remember, its label caption and button caption, two different things.

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 ...