Page 1 of 2 12 LastLast
Results 1 to 40 of 60

Thread: Direct Speech Recognition

  1. #1

    Thread Starter
    Hyperactive Member
    Join Date
    Mar 2000
    Location
    Canada
    Posts
    264

    Angry

    I have the following code:

    'this in the form_load
    DirectSR1.GrammarFromFile App.Path & "g:\stuff\vb\msagents\grammer.txt"
    DirectSR1.Activate

    ' this in the control
    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)
    MsgBox "hh"
    If Phrase = "HI" Then
    'Do Something
    ElseIf Phrase = "Bye" Then
    End
    Else
    MsgBox "Here"
    End If
    'DirectSR1.Speak "Hello"

    End Sub


    and I have the text file (grammer.txt):
    [Grammar]
    type=cfg
    [<start>]
    <start>=HI
    <start>=Bye

    It doesn't work !!

    How do I make it listen to me ???

    thank you


    In the beginning the universe was created. This has made a lot of people very angry and is generally regarded as a bad idea.

    - Douglas Adams
    The Hitchhiker's Guide to the Galaxy

  2. #2
    Guest
    Is this what you meant to have wrote?:

    Code:
    DirectSR1.GrammarFromFile App.Path & "g:\stuff\vb\msagents\grammer.txt

    Shouldn't it have been either:

    Code:
    DirectSR1.GrammerFromFile App.Path & "\grammer.txt"
    or

    Code:
    DirectSR1.GrammerFromFile "g:\stuff\vb\msagents\grammer.txt"
    ??

    But I don't see any problems with your actual PhraseFinish event. If it still doesn't work, try a simpler Select Case to choose the Phrase and try simpler words first. Like just "1" and "2"


    Sunny

  3. #3

    Thread Starter
    Hyperactive Member
    Join Date
    Mar 2000
    Location
    Canada
    Posts
    264
    Are you suppose to press anything when you speak to the microphone ? or is the "channel" open all the time, and you just need to speak ?

    You are right about the syntax .. :-) thanks, it was late at night ..
    thanks
    In the beginning the universe was created. This has made a lot of people very angry and is generally regarded as a bad idea.

    - Douglas Adams
    The Hitchhiker's Guide to the Galaxy

  4. #4

    Thread Starter
    Hyperactive Member
    Join Date
    Mar 2000
    Location
    Canada
    Posts
    264
    o.k, forget about the last one ..

    It is working now..

    I would like to know what "tags" I can use other then the "<start>" in my grammer.txt file (if there are any) or if you know where I can find good documentation about it ..

    THANK YOU ! :-)
    In the beginning the universe was created. This has made a lot of people very angry and is generally regarded as a bad idea.

    - Douglas Adams
    The Hitchhiker's Guide to the Galaxy

  5. #5
    Frenzied Member HarryW's Avatar
    Join Date
    Jan 2000
    Location
    Heiho no michi
    Posts
    1,827
    I know it's petty, but 'grammar' doesn't have an 'e' in it
    Harry.

    "From one thing, know ten thousand things."

  6. #6

    Thread Starter
    Hyperactive Member
    Join Date
    Mar 2000
    Location
    Canada
    Posts
    264
    well, in my GRAMMER there is :-) !!!
    You can have yours and call it what ever you like

    by the way, how do you do the "faces"/ bold writing in the body of the message ?
    In the beginning the universe was created. This has made a lot of people very angry and is generally regarded as a bad idea.

    - Douglas Adams
    The Hitchhiker's Guide to the Galaxy

  7. #7
    Addicted Member
    Join Date
    Sep 2000
    Location
    Atlanta, GA
    Posts
    177

    Talking Speech Recognition

    There is a possibility that your coding does work. Unfortunately Speech Recognition has several draw backs, with the major one being pronounciation. The progam may be hearing you OK but doesn't recognize what it thinks it heard. There is also a possibility of a faulty sound card. Run your speech engine's test feature to make sure evrything is turned on and working properly. I have a speech engine that I downloaded from Microsoft's Developer Web Site. It's called Microsoft Speech SDK / Microsoft Voice, this program has so much support that the impossible will become possible, and it readily connects to VB. Good luck. Any clue as to what you are working on? I've been working with voice activation for over 3 years, maybe I can help.
    212 will lead you to the truth

  8. #8

    Thread Starter
    Hyperactive Member
    Join Date
    Mar 2000
    Location
    Canada
    Posts
    264
    Well, for now I am making something for my own use.

    It is a MSagent that is like a "desktop friend", it reads me the things I put in the clipboard, from time to time it says stuff and moves (randomly).


    The speech recognition is working now, and to be quite honest it even understands me :-)

    things like "date", "time" ,"Joke" ...



    you say that this SDK is a better engine ?
    I will try it out.
    do you have an exact link that I can reffer to ?

    Thank you

    In the beginning the universe was created. This has made a lot of people very angry and is generally regarded as a bad idea.

    - Douglas Adams
    The Hitchhiker's Guide to the Galaxy

  9. #9

    Thread Starter
    Hyperactive Member
    Join Date
    Mar 2000
    Location
    Canada
    Posts
    264
    Well, I downloaded the SDK engine, installed it and now I want to use the dictation control.

    I put a control on my form (vdict1) and triggered the activate method ...
    and put some code like:

    Private Sub Vdict1_PhraseFinish(ByVal flags As Long, ByVal phrase As String)
    Text1.Text = Text1.Text & phrase
    End Sub

    but nothing happened when I spoke ... so I went to the help files, and they say that the "mode" should be set to:

    VSRMODE_DCTONLY

    but what the hell is this constant ???

    I will appriciate it if someone can send me a demo for it, or post something here ..

    Thank you
    In the beginning the universe was created. This has made a lot of people very angry and is generally regarded as a bad idea.

    - Douglas Adams
    The Hitchhiker's Guide to the Galaxy

  10. #10
    Guest
    I have sent you a demo...say 1, 2 or 3

    With your last one, you've activated it, by did you load a grammar file?

    Sunny

  11. #11
    Guest

    Thumbs up Where can i get Direct Speech

    Hi there.

    Whre can i get direct speech control, so i can make my self "Talking computer" , thank´s

    numibesi

  12. #12
    Guest
    You can download it from Microsoft Agent's website:

    http://msdn.microsoft.com/workshop/i...nt/default.asp


    Sunny

  13. #13
    Guest
    When using GrammarFromFile you don't need all that <start> stuff. You would only need that when using GrammarFromString.

  14. #14
    Addicted Member
    Join Date
    Sep 2000
    Location
    Atlanta, GA
    Posts
    177

    Talking Voice Command

    You seem to be having a rough go at it. When I started doing Speech Recognition. I had similar errors that seemed to come from no where. There's are alot of simple coding that comes with Microsoft SAPI 4.0. I didn't bring any voice activation coding to work with me. But i can send you some tomorrow. But here is some of the coding that comes with the program for VB.

    To test if your program is listening and hearing correctly use this code:

    Dim gMymenu As Long

    Private Sub UpdateList()
    Dim i As Long
    Dim command As String
    Dim description As String
    Dim category As String
    Dim flags As Long
    Dim action As String

    List1.Clear
    tcount = Vcommand1.CountCommands(gMymenu)
    For i = 1 To tcount
    Vcommand1.GetCommand gMymenu, i, command, description, category, flags, action
    List1.AddItem command
    Next i
    End Sub

    Private Sub Command1_Click()
    If (Text2.Text <> "") Then
    Vcommand1.AddCommand gMymenu, 1, Text2.Text, "when you say " + Text2.Text, "listen list", 0, ""
    End If
    UpdateList

    End Sub

    Private Sub Command2_Click()
    If (List1.ListIndex >= 0) Then
    Vcommand1.Remove gMymenu, List1.ListIndex + 1
    End If
    UpdateList
    End Sub

    Private Sub Command3_Click()
    If Command3.Caption = "Listen" Then
    Vcommand1.Activate gMymenu
    Command3.Caption = "Stop Listening"
    List1.Enabled = True
    Else
    Vcommand1.Deactivate gMymenu
    Command3.Caption = "Listen"
    List1.Enabled = False
    End If

    End Sub

    Private Sub Form_Load()
    Vcommand1.Initialized = 1
    gMymenu = Vcommand1.MenuCreate(App.EXEName, "state1", 4)
    Vcommand1.Enabled = 1
    Vcommand1.AddCommand gMymenu, 1, "red", "when you say" + "red", "listen list", 0, ""
    Vcommand1.AddCommand gMymenu, 1, "blue", "when you say" + "blue", "listen list", 0, ""
    Vcommand1.AddCommand gMymenu, 1, "green", "when you say" + "green", "listen list", 0, ""
    UpdateList
    Vcommand1.Activate gMymenu
    End Sub


    Private Sub Form_Unload(Cancel As Integer)
    Vcommand1.ReleaseMenu gMymenu
    End Sub

    Private Sub Vcommand1_CommandRecognize(ByVal ID As Long, ByVal CmdName As String, ByVal flags As Long, ByVal action As String, ByVal NumLists As Long, ByVal ListValues As String, ByVal command As String)
    Label3.Caption = command
    End Sub

    You can also modify this coding to perform text to speech. In my long journy to the land of voice activation this coding opened the doors that had been closed to me for a long time. Let me know what happens.
    212 will lead you to the truth

  15. #15
    Guest

    Exclamation

    When I was playing with MSAgent I fiddled for hours with no luck from the voice recognition, the key was to press scroll lock to make the agent listen.

  16. #16
    Guest
    I find it hard to believe that the Scroll lock key needs to be pressed, mainly because I've used voice recognition without any problems, and also, if a key was needed to be pressed before it listens, it wouldn't be Scroll lock - its a very unconventional place to put a key for such a purpose as it is usually not within fingers' reach of the typist like Control or shift.

    Sunny

  17. #17
    Guest
    Sunny, the following is a cut and paste from troubleshooting Agents from MSDN, you will find it makes for dull bed time reading but is nevertheless a good source of info!


    Verify that the Agent-enabled application or Web page supports speech input. Not all pages or applications support speech input. Press and hold the Listening key. Typically this will be the Scroll Lock key unless you changed it. A pop-up window should appear under the character. The text in the tip will tell you the listening state of the character. If no tip appears, either the application or Web page does not support speech input, or you don't have a compatible speech engine installed. If the tip does appear and indicates the character is listening, speak one of the character's voice commands. If you do not know what voice commands are available, release the Listening key and right-click the character.


    SDK beta 5 download at http://www.microsoft.com/speech/

    [Edited by MadWorm on 09-21-2000 at 06:15 AM]

  18. #18
    Fanatic Member
    Join Date
    Aug 2000
    Location
    I'm right here!
    Posts
    849
    What is this DirectSP control and where can I get it?
    Dekel C.

  19. #19
    Guest
    Maybe someone can clear this up, there seems to be two types of TTS and STT here... one seems to be Microsoft Agent (involving the characters) which MadWorm mentioned, and there seems to be another one which I think is the one asabi is having problems with (he is trying to use Voice Dictation).

    MS Agent:
    http://msdn.microsoft.com/workshop/i...nt/default.asp

    'the other one'
    http://www.microsoft.com/IIT/download/speechengines.htm


    Sunny

    [Edited by sunnyl on 09-21-2000 at 07:10 AM]

  20. #20

    Thread Starter
    Hyperactive Member
    Join Date
    Mar 2000
    Location
    Canada
    Posts
    264
    Well said sunnyl !

    You are right, and I still can't make the dictation to work (the commands and the voice recognition are working perfectly..) :-)

    Thank you for helping
    In the beginning the universe was created. This has made a lot of people very angry and is generally regarded as a bad idea.

    - Douglas Adams
    The Hitchhiker's Guide to the Galaxy

  21. #21
    Guest
    I've downloaded the SAPI SDK and help files. Although it says it has sample code, the 'sample code' for voice dictation is a full blown application, it wasn't easy to understand (and I still don't), but this code seems to work when dictating:

    Code:
    Option Explicit
    
    Private Sub Form_Load()
        Vdict1.Speaker = "Sunny"     'uses my profile?
        Vdict1.Mode = 32       'dictation only mode (?)
        Vdict1.Activate
    End Sub
    
    Private Sub Vdict1_PhraseFinish(ByVal flags As Long, ByVal phrase As String)
        Text1.Text = Text1.Text & " " & phrase
    End Sub
    When I ran it and said "testing testing 1 2 3" I got a result of "testing testing one to three" several times.

    Sunny

  22. #22

    Thread Starter
    Hyperactive Member
    Join Date
    Mar 2000
    Location
    Canada
    Posts
    264
    GREAT !!!

    Thank you very much !

    It is working at last ... but it is really funny ...

    I say "go" it writes "no"

    I say "wolf" it writes "would"

    But I guess that's as good as it can get :-)

    Thank you very much for all !!!

    Cheers



    In the beginning the universe was created. This has made a lot of people very angry and is generally regarded as a bad idea.

    - Douglas Adams
    The Hitchhiker's Guide to the Galaxy

  23. #23
    Guest
    You should train it more so that it becomes more accurate. I tried running the program with and without the lines Vdict1.Speaker and there seemed to be a bit of difference. I also find that I actually have to set the Accuracy vs Speed setting right to the speed end to get a reasonable response time. I have a PII 350.


    Sunny

  24. #24
    Guest
    It is annoying.

    Last time I've make the same thing for word (Auto-type) but Guess what? I gave the command "Type R V S E T Y D E O R R" and it typed "ARVEASEEIEYEEORR".

    Expect it, I trained it 3 or 4 times...

  25. #25

    Thread Starter
    Hyperactive Member
    Join Date
    Mar 2000
    Location
    Canada
    Posts
    264
    I also have a PII 350, it has 256MB ram, and it still takes it a sec or so before it reacts .., and when it does ... :-) it almost seems as if it has its own imagination ..

    In the beginning the universe was created. This has made a lot of people very angry and is generally regarded as a bad idea.

    - Douglas Adams
    The Hitchhiker's Guide to the Galaxy

  26. #26
    Fanatic Member
    Join Date
    Aug 2000
    Location
    I'm right here!
    Posts
    849
    Where can I get one of these control?
    It seems realy cool to add them to my app.
    Dekel C.

  27. #27

    Thread Starter
    Hyperactive Member
    Join Date
    Mar 2000
    Location
    Canada
    Posts
    264
    In the beginning the universe was created. This has made a lot of people very angry and is generally regarded as a bad idea.

    - Douglas Adams
    The Hitchhiker's Guide to the Galaxy

  28. #28
    Lively Member
    Join Date
    Jun 2000
    Posts
    67
    I'm downloading: Microsoft Speech Recognition Engine for PC command &
    control applications

    any help on how i can use that?
    Private Sub DeepCrap
    on error blame microsoft
    if microsoft = screwed then
    blame aol
    end if
    end deep crap

    Ahh VB6 Enterprise Edition

  29. #29
    New Member
    Join Date
    May 2000
    Posts
    8

    Exclamation Errors

    Whenever I try to use the speech dictation control from Microsoft, as well as some other MS voice controls, VB says that "another program is requesting the same control", or something like that, and I can never put down one of those controls. What should I do, because I REALLY want to use speech dictation in my software? Please e-mail me back at [email protected]
    ***** VB RULES!!! *****

  30. #30
    Fanatic Member
    Join Date
    Aug 2000
    Location
    I'm right here!
    Posts
    849
    The activeX from MS is an exe, hoe can I use it?
    Dekel C.

  31. #31
    Guest
    dekelc, MS has many different packages for speech recognition and text to speech, which one have you downloaded?

    Sunny

  32. #32
    Fanatic Member
    Join Date
    Aug 2000
    Location
    I'm right here!
    Posts
    849
    I've downloaded the Microsoft Speech Recognition Engine for PC command & control applications control.
    Dekel C.

  33. #33
    Fanatic Member
    Join Date
    Aug 2000
    Location
    I'm right here!
    Posts
    849
    I've activated the exe for the
    Microsoft Speech Recognition Engine for PC command & control applications control,
    it show me a few files, non of them is ocx.
    What am I doing wrong?
    Dekel C.

  34. #34
    Addicted Member
    Join Date
    Sep 2000
    Location
    Atlanta, GA
    Posts
    177
    I've tried that tag bit, but when your command list get's long you will run into a line continuation error. I had to resort to storing the commands in a list box. This works, the only drawback is, if the computer is turned off and back on, the SDK doesn't automatically load the commands from the list box, however the list box still holds the commands. This suggests that the command list is not permantly saved. Any of you CDM/W's know how to solve this problem and permanently save the commands storeed in the list box?
    212 will lead you to the truth

  35. #35
    Guest
    dekelc, start a new VB project, goto Project => Components and in the list look for Microsoft Direct Speech Recognition. When you find it, check its box and click ok then you should have a new control on your toolbox.

    Doc, Can you do it manually by saving the contents of the list to a file when your program closes and reloads the file when it starts up?

    Sunny

  36. #36
    Fanatic Member
    Join Date
    Aug 2000
    Location
    I'm right here!
    Posts
    849
    There is no control like that in the components box!
    Dekel C.

  37. #37
    Guest
    Don't panic! It just means the package you downloaded didn't have DirectSR (Speech Recognition). I suggest you download the largest package, which has everything... http://www.microsoft.com/iit

    For the time being, look for these other ones, at least you'll know you've installed something.

    Microsoft Direct Speech Recognition
    Microsoft Direct Text-to-Speech
    Microsoft Voice Dictation (theres an example i wrote earlier in the thread for this)
    Microsoft Voice Command
    Microsoft Voice Text


    Sunny

  38. #38
    Addicted Member
    Join Date
    Sep 2000
    Location
    Atlanta, GA
    Posts
    177
    Originally posted by sunnyl
    dekelc, start a new VB project, goto Project => Components and in the list look for Microsoft Direct Speech Recognition. When you find it, check its box and click ok then you should have a new control on your toolbox.

    Doc, Can you do it manually by saving the contents of the list to a file when your program closes and reloads the file when it starts up?

    Sunny
    212 will lead you to the truth

  39. #39
    Addicted Member
    Join Date
    Sep 2000
    Location
    Atlanta, GA
    Posts
    177
    Sunny,

    I have an idea of what you are saying, but still a little confused as to how it will load. Do you have any sample code that displays the process?
    212 will lead you to the truth

  40. #40
    Guest
    I may be wrong here, but you say that if there are too many commands in the file, it will go into a line continuation error. And you loaded the commands into a listbox instead. but the next time around, the commands are in the listbox but they are not recognised, right?

    Then you don't have to use GrammarFromFile, you can use GrammarFromString. You can load each of the commands in the listbox with GrammarFromString if the file is too long and causes an error.


    Sunny

Page 1 of 2 12 LastLast

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