VB Code:
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