Click to See Complete Forum and Search --> : Using Speech Recognition and Text2Speech controls in VB apps????
Virtual24
May 19th, 2001, 03:10 PM
PLEASE!!! I need help on how to get the code for the Speech Recognition (DirectSR) and Text to Speech (DirectSS) controls to work... I downloaded the SDK 5.0 already and installed it. i've done the normal "Phrase thing" but it never picks up my word. and i use this: DirectSS1.Speak ("Hello.") and that doesn't work either... I have all the references and components added and it works when i test i under the thing in the control pannel. HELP ME!!!:confused: :confused: :confused:
Megatron
May 19th, 2001, 03:38 PM
Try this:
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)
If Phrase = "hello" Then
Phrase = ""
DirectSS1.Speak "Hi to you too."
End If
If Phrase = "bye" Then
Phrase = ""
DirectSS1.Speak "goodbye."
End If
Text1.Text = Phrase
End Sub
Private Sub Form_Load()
' The following are words that the Engine will reconize
DirectSR1.GrammarFromString "[Grammar]" + vbNewLine + _
"type=cfg" + vbNewLine + _
"[<start>]" + vbNewLine + _
"<start>=hello" + vbNewLine + _
"<start>=bye" + vbNewLine
DirectSR1.Activate
End Sub
Speak the words "Hello" and "Bye," and the computer should reply.
Megatron
May 19th, 2001, 03:48 PM
Also, make sure that you train your engine every so often to that the DirectSR control (or engine) can recognize your voice more easily.
GuitarMan
May 22nd, 2001, 03:44 PM
use Directss1.sayit = "Hello"
while im at it anyone ever worked with flightsim 2000?
vbforums.com
Copyright Internet.com Inc., All Rights Reserved.