by MOLF52 (2 Submissions)
Category: Miscellaneous
Compatability: VB 6.0
Difficulty: Unknown Difficulty
Originally Published: Mon 6th October 2003
Date Added: Mon 8th February 2021
Rating: (1 Votes)
Source Code for Voice Recognation Program with two simple commands (Open/Close CD-ROM). Please download the last update of Direct Speech
'Rename Direct Speech Recognation as DVoice01
'Rename Direct Text-to-Speech as DSpeak01
'Insert a TextBox and rename it as TB01
Private Sub Form_Load()
Dim SpeechGrammer As String
SpeechGrammer = "[Grammar]" & vbCrLf & _
"langid = 1033" & vbCrLf & _
"type=cfg" & vbCrLf & _
"[<Start>]" & vbCrLf & _
"<start>=" & "open" & vbCrLf & _ 'entering recognize commands
"<start>=" & "close"
DVoice01.GrammarFromString SpeechGrammer
DVoice01.Activate
DSpeak01.Speak "I can speak, tell me open or close and look your CD-ROM"
End Sub
Private Sub DVoice01_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)
Dim lRet As Long
Select Case Phrase
Case Is = "open":
TB01.Text = "OPEN"
lRet = mciSendString("set CDAudio door open", returnstring, 127, 0)
Case Is = "close"
TB01.Text = "CLOSE"
lRet = mciSendString("set CDAudio door closed", returnstring, 127, 0)
End Select
End Sub
No comments have been posted about Source Code for Voice Recognation Program with two simple commands (Open/Close CD-ROM). Please down. Why not be the first to post a comment about Source Code for Voice Recognation Program with two simple commands (Open/Close CD-ROM). Please down.