- Home
·
- Miscellaneous
·
- Source Code for Voice Recognation Program with two simple commands (Open/Close CD-ROM). Please down
Source Code for Voice Recognation Program with two simple commands (Open/Close CD-ROM). Please down
Source Code for Voice Recognation Program with two simple commands (Open/Close CD-ROM). Please download the last update of Direct Speech
Rate Source Code for Voice Recognation Program with two simple commands (Open/Close CD-ROM). Please down
(2(2 Vote))
'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
Source Code for Voice Recognation Program with two simple commands (Open/Close CD-ROM). Please down Comments
No comments yet — be the first to post one!
Post a Comment