Results 1 to 15 of 15

Thread: Voice Commands -- Speech Recognition..

  1. #1

    Thread Starter
    Fanatic Member tim_l_012's Avatar
    Join Date
    Mar 2001
    Location
    Next to a Coffee Cup.
    Posts
    641

    Angry 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 :/

  2. #2
    sunnyl
    Guest
    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.

  3. #3
    sunnyl
    Guest
    And if you're serious about using VB3.....the MS Speech SDK Suite min requirements is VB5.

  4. #4

    Thread Starter
    Fanatic Member tim_l_012's Avatar
    Join Date
    Mar 2001
    Location
    Next to a Coffee Cup.
    Posts
    641
    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 :/

  5. #5
    sunnyl
    Guest
    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

  6. #6

    Thread Starter
    Fanatic Member tim_l_012's Avatar
    Join Date
    Mar 2001
    Location
    Next to a Coffee Cup.
    Posts
    641
    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 :/

  7. #7
    sunnyl
    Guest
    SAPI4SDKSUITE

    It has the other two included in the installation

  8. #8

    Thread Starter
    Fanatic Member tim_l_012's Avatar
    Join Date
    Mar 2001
    Location
    Next to a Coffee Cup.
    Posts
    641
    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 :/

  9. #9
    sunnyl
    Guest
    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!

  10. #10

    Thread Starter
    Fanatic Member tim_l_012's Avatar
    Join Date
    Mar 2001
    Location
    Next to a Coffee Cup.
    Posts
    641
    why can I insert voice recognition controls then?
    /: Tim :\____________________
    \: VB, HTML, ASP, VBScript, QBASIC, JavaScript :/

  11. #11
    sunnyl
    Guest
    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.

  12. #12

    Thread Starter
    Fanatic Member tim_l_012's Avatar
    Join Date
    Mar 2001
    Location
    Next to a Coffee Cup.
    Posts
    641
    so when I distribute my app... I need to include any dlls I used??

    Thanks so far,
    /: Tim :\____________________
    \: VB, HTML, ASP, VBScript, QBASIC, JavaScript :/

  13. #13
    sunnyl
    Guest
    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.

  14. #14

    Thread Starter
    Fanatic Member tim_l_012's Avatar
    Join Date
    Mar 2001
    Location
    Next to a Coffee Cup.
    Posts
    641
    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 :/

  15. #15
    sunnyl
    Guest
    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
  •  



Click Here to Expand Forum to Full Width