Looking for work? Check out our jobs area.

VB.NET

Moderators: seancampbell
Number of threads: 3618
Number of posts: 9200

This Forum Only
Post New Thread

Report
problem with VB.NET SAPI 5.1 Posted by kaex21 on 9 Nov 2009 at 6:58 PM
hi to everyone
i having this problem about sapi 5.1 and vb.net.. i cant run the program becuase it gives me an error.. i think the engine is not running or my codes is incorrect..

can you help me guys to solve this problem??

very much appreciated.. thanks!!

here's my code...

Private Sub main_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
        gmode = 0
        gRestoreGrammar = False

        On Error GoTo GeneralFail
        Dim engine
        REM Initialize the recognizer. We want command and control, so find and select that engine (or best match)
        AxDirectSR1.Initialized = 1

        engine = AxDirectSR1.Find("MfgName=Microsoft;Grammars=1")
        AxDirectSR1.Select(engine)

        REM menu.txt is our uncompiled grammar. Compile and load it now.
                AxDirectSR1.GrammarFromFile("C:\Documents and Settings\kaex21\My Documents\Visual Studio 2008\Projects\Project1\WindowsApplication6\WindowsApplication6\menu.txt")
        REM Now load the synthesizer, find and select any female voice from microsoft
        AxDirectSR1.EngineId(AxDirectSR1.Find("MfgName=Microsoft;Grammars=1"))

        REM Start the voice interface...control goes to DirectSS1_AudioStop after this is said, gMode=0
        AxDirectSS1.Speak("Welcome to kaex restaurant, sit back and enjoy as you take your order.")

        REM sometimes the vb environment comes to front while we're loading, so take the screen back
        Me.Show()
        GoTo done
GeneralFail:
        MsgBox("Unable to start using text to speech or recognition.")
done:

    End Sub




 
Popular resources and forums for programmers on Programmersheaven.com
Assembly, Basic, C, C#, C++, Delphi, Java, JavaScript, Pascal, Perl, PHP, Python, Ruby, Visual Basic
© Copyright 2009 Programmersheaven.com - All rights reserved.
Reproduction in whole or in part, in any form or medium without express written permission is prohibited.
Violators of this policy may be subject to legal action. Please read our Terms Of Use and Privacy Statement for more information.
Publisher: Lars Hagelin. Read the latest words from the publisher here.
Be the first to sign up for Lars Hagelin’s In-depth Outsourcing Newsletter here.
bootstrapLabs Logo A bootstrapLabs project.