by chang (1 Submission)
Category: Custom Controls/Forms/Menus
Compatability: VB 6.0
Difficulty: Unknown Difficulty
Originally Published: Thu 13th September 2001
Date Added: Mon 8th February 2021
Rating: (1 Votes)
speech recognition program using microsoft speech api sdk
API Declarations
microsoft speech api sdk version 4. It is downloadable at the
site www.o2a.com/SpeechDownload.htm (download the 40MB sapisdksuite)
You can also get the version 5 at microsoft web site, but the version
5 do not support win95 and the memory requirement is quite high.
After the download and installation, goto start->program and click
microsoft voice. This will configure your microphone setting.
At last, open vb and load in the component "microsoft direct speech
recognition(xlisten.dll) "
'By using phrasefisnish event, you can do anything on your computer
'by just using your voice.
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)
Text1.Text = Phrase
End Sub
Private Sub Form_Load()
DirectSR1.GrammarFromString "[Grammar]" + vbNewLine + _
"type=cfg" + vbNewLine + _
"[<start>]" + vbNewLine + _
"<start>=red" + vbNewLine + _
"<start>=blue" + vbNewLine + _
"<start>=green" + vbNewLine
DirectSR1.Activate
End Sub