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