|
-
Sep 18th, 2000, 04:03 AM
#1
Thread Starter
Hyperactive Member
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
-
Sep 18th, 2000, 07:27 AM
#2
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
-
Sep 18th, 2000, 11:11 AM
#3
Thread Starter
Hyperactive Member
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
-
Sep 18th, 2000, 11:19 AM
#4
Thread Starter
Hyperactive Member
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
-
Sep 18th, 2000, 11:23 AM
#5
Frenzied Member
I know it's petty, but 'grammar' doesn't have an 'e' in it
Harry.
"From one thing, know ten thousand things."
-
Sep 18th, 2000, 11:31 AM
#6
Thread Starter
Hyperactive Member
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
-
Sep 19th, 2000, 03:32 PM
#7
Addicted Member
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
-
Sep 19th, 2000, 08:39 PM
#8
Thread Starter
Hyperactive Member
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
-
Sep 20th, 2000, 01:00 AM
#9
Thread Starter
Hyperactive Member
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
-
Sep 20th, 2000, 07:03 AM
#10
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
-
Sep 20th, 2000, 07:49 AM
#11
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
-
Sep 20th, 2000, 04:43 PM
#12
You can download it from Microsoft Agent's website:
http://msdn.microsoft.com/workshop/i...nt/default.asp
Sunny
-
Sep 20th, 2000, 05:35 PM
#13
When using GrammarFromFile you don't need all that <start> stuff. You would only need that when using GrammarFromString.
-
Sep 20th, 2000, 05:46 PM
#14
Addicted Member
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
-
Sep 21st, 2000, 01:29 AM
#15
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.
-
Sep 21st, 2000, 02:23 AM
#16
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
-
Sep 21st, 2000, 04:33 AM
#17
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]
-
Sep 21st, 2000, 04:53 AM
#18
Fanatic Member
What is this DirectSP control and where can I get it?
-
Sep 21st, 2000, 06:05 AM
#19
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]
-
Sep 21st, 2000, 09:28 AM
#20
Thread Starter
Hyperactive Member
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
-
Sep 21st, 2000, 07:57 PM
#21
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
-
Sep 21st, 2000, 11:57 PM
#22
Thread Starter
Hyperactive Member
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
-
Sep 22nd, 2000, 12:09 AM
#23
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
-
Sep 22nd, 2000, 12:28 AM
#24
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...
-
Sep 22nd, 2000, 12:58 AM
#25
Thread Starter
Hyperactive Member
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
-
Sep 23rd, 2000, 08:44 AM
#26
Fanatic Member
Where can I get one of these control?
It seems realy cool to add them to my app.
-
Sep 23rd, 2000, 09:59 AM
#27
Thread Starter
Hyperactive Member
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
-
Sep 23rd, 2000, 12:44 PM
#28
Lively Member
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
-
Sep 23rd, 2000, 01:29 PM
#29
New Member
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]
-
Sep 23rd, 2000, 02:40 PM
#30
Fanatic Member
The activeX from MS is an exe, hoe can I use it?
-
Sep 23rd, 2000, 06:30 PM
#31
dekelc, MS has many different packages for speech recognition and text to speech, which one have you downloaded?
Sunny
-
Sep 24th, 2000, 07:37 AM
#32
Fanatic Member
I've downloaded the Microsoft Speech Recognition Engine for PC command & control applications control.
-
Sep 25th, 2000, 08:23 AM
#33
Fanatic Member
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?
-
Sep 25th, 2000, 09:38 AM
#34
Addicted Member
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
-
Sep 25th, 2000, 06:09 PM
#35
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
-
Sep 26th, 2000, 01:32 AM
#36
Fanatic Member
There is no control like that in the components box!
-
Sep 26th, 2000, 01:44 AM
#37
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
-
Sep 26th, 2000, 10:39 AM
#38
Addicted Member
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
-
Sep 26th, 2000, 10:40 AM
#39
Addicted Member
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
-
Sep 27th, 2000, 01:51 AM
#40
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
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
|