|
-
Mar 6th, 2002, 01:45 AM
#1
Thread Starter
Fanatic Member
Voice Commands -- Speech Recognition..
I am using the following code:
Code:
Option Explicit
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)
'this event fires when directSR comes up with a result
'the word that has been recognised is stored
'in the Phrase argument
Select Case Phrase
Case Is = "red"
MsgBox "you said red"
Case "green"
MsgBox "you said green"
Case Is = "blue"
MsgBox "you said blue"
Case Else
MsgBox "what the?!"
End Select
End Sub
Private Sub Form_Load()
Dim GrammarStr As String
'this is the list of words that directSR will
'recognise
GrammarStr = "[Grammer]" + vbNewLine + _
"type=cfg" + vbNewLine + _
"[<start>]" + vbNewLine + _
"<start>=red" + vbNewLine + _
"<start>=green" + vbNewLine + _
"<start>=blue" + vbNewLine
'load the words to recognise
DirectSR1.GrammarFromString GrammarStr
'start listening
DirectSR1.Listen
End Sub
when I run my app, it doesn't even recognise me saying anything!!
it doens't even bring up the msgbox with WHAT THE?!
what is going wrong??
Thanks,
/: Tim :\____________________
\: VB, HTML, ASP, VBScript, QBASIC, JavaScript :/
-
Mar 6th, 2002, 01:50 AM
#2
A bit of a give away with DirectSR is that you can tell if its installed properly by the time it takes to load.
Even on fast computers, there will be some HDD activity while the program loads, and this will be quite obvious if theres nothing else in the program like in this case.
See whether there is some HDD activity or delay in running the program.
-
Mar 6th, 2002, 01:51 AM
#3
And if you're serious about using VB3.....the MS Speech SDK Suite min requirements is VB5.
-
Mar 6th, 2002, 01:53 AM
#4
Thread Starter
Fanatic Member
nope.. no disk activity.. why isn't it loading??
I didn't download any speech recognition stuff from microsoft, It was in my components list when I installed Visual Studio 6...
(that reminds me... update my signature... )
is this ok to be using?
/: Tim :\____________________
\: VB, HTML, ASP, VBScript, QBASIC, JavaScript :/
-
Mar 6th, 2002, 01:56 AM
#5
If it isn't loading, the chances are its not installed properly...
And I don't think the Speech SDK comes standard with any version of VB installations. So it might've been installed another way. But I'd suggest you download the SDK first.
www.microsoft.com/speech
The code is for 4.0a
-
Mar 6th, 2002, 02:00 AM
#6
Thread Starter
Fanatic Member
what should I download??
SAPI4SDK.exe - 8,023 Kb
SAPI4SDKSUITE.exe - 40,001 Kb
spchapi.EXE - 848 Kb
thanks for all your help so far!!
/: Tim :\____________________
\: VB, HTML, ASP, VBScript, QBASIC, JavaScript :/
-
Mar 6th, 2002, 02:02 AM
#7
SAPI4SDKSUITE
It has the other two included in the installation
-
Mar 6th, 2002, 02:03 AM
#8
Thread Starter
Fanatic Member
im using windows 2000 pro...
is there any speech recognition stuff that comes with that??
if so I have to download the suite...
the others dont have there own engine....

Thanks...
/: Tim :\____________________
\: VB, HTML, ASP, VBScript, QBASIC, JavaScript :/
-
Mar 6th, 2002, 02:06 AM
#9
No Win2k doesn't have any of it installed.
But Office XP does. It uses Speech SDK 5.
5.0 wasn't really good for VB, 5.1 is better, but is largely OOed and not easy to use.
I think 4.0a is the easiest to use!
-
Mar 6th, 2002, 02:15 AM
#10
Thread Starter
Fanatic Member
why can I insert voice recognition controls then?
/: Tim :\____________________
\: VB, HTML, ASP, VBScript, QBASIC, JavaScript :/
-
Mar 6th, 2002, 02:21 AM
#11
Probably because another application that uses the speech controls installed it.
A problem with 4.0 is distributing it. When making packages, two other packages that are inside SAPI4SDKSUITE need to be included for the engine to work on computers that don't have the SDK installed. Most people see Xlisten.dll listed and include this DLL in their packages expecting other computers to work as well. But this isn't the case.
As long as you have Xlisten.dll, you can see it listed as a component, but whether it works and installed properly is another thing. Its like Xlisten.dll depends on something else that the P&D wizard can't see (but which the other two packages install). Thats why I started off asking whether you got any HDD activity, rather than asking you whether you had the SDK installed.
-
Mar 6th, 2002, 02:28 AM
#12
Thread Starter
Fanatic Member
so when I distribute my app... I need to include any dlls I used??
Thanks so far,
/: Tim :\____________________
\: VB, HTML, ASP, VBScript, QBASIC, JavaScript :/
-
Mar 6th, 2002, 02:46 AM
#13
This is the hard part....I spent many painstaking hours figuring this out.......
When you install the speech SDK, goto your TEMP directory, and notice the new folders created. As you are prompted each time by the installation, it is extracting another 'sub' package (hence its a SDK suite). The two 'sub' packages you want are: mscsr.exe (about 20mbs) and spchapi.exe.
These two packages need to be installed in the user's computer if they do not have the SDK.
-
Mar 7th, 2002, 12:43 AM
#14
Thread Starter
Fanatic Member
how can I incorporate those files into my installation program??
I will either make my own, or just use the 'Application Setup Wizard'
Thanks All,
/: Tim :\____________________
\: VB, HTML, ASP, VBScript, QBASIC, JavaScript :/
-
Mar 7th, 2002, 12:52 AM
#15
I use InnoSetup
http://www.jrsoftware.org/isinfo.php
Its got its own little scripting language to create an installation, and one of the commands allow execution of an external exe during installation.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|