Torna al Thread
Option Explicit
Dim FlagAttivo As Boolean
Private Sub Form_Load()
FlagAttivo = False
vcrRecognition.GrammarFromString "[Grammar]" + vbNewLine + "type=cfg" + vbNewLine + "[<Start>]" + vbNewLine + "<start>=Prueva" + vbNewLine
'vcrRecognition.Listen
End Sub
Private Sub btAbilita_Click()
Select Case FlagAttivo
Case True
FlagAttivo = False
vcrRecognition.Deactivate
lblStatus.Caption = "Chiuso"
Case False
FlagAttivo = True
vcrRecognition.Activate
lblStatus.Caption = "In ascolto"
End Select
End Sub
Private Sub vcrRecognition_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)
Select Case Phrase
Case "Prueva"
spkSpeak.Speak "Prueva"
Case Else
spkSpeak.Speak "Cioè?"
End Select
End Sub