Library tutorials & articles
Speech Recognition
- Introduction
- Getting Started
- The Basics
- At last, some code!
- And more code...
- Rounding up
And more code...
To declare the API put the following code at top of the form code.
Option Explicit
Private Declare Function ShellExecute Lib "shell32.dll" _
Alias "ShellExecuteA" (ByVal hwnd As Long, ByVal _
lpOperation As String, ByVal lpFile As String, ByVal _
lpParameters As String, ByVal lpDirectory As String, _
ByVal nShowCmd As Long) As Long
The core of the sample is basically done, however, as you know, nothing is really done without some style with the GUI. Here is the plan, lets put a button on the form to stop the recognition engine and also to start the engine when its stopped. Also, lets put a label to show the status of the engine and the recognized word.
Place a label on the form. Next place a buttom on the form. Set it's caption property to Enable and then double click on the button to open the code. Place the following code inside:
Private Sub Command1_Click()
Select Case Command1.Caption
Case "Disable"
DirectSR1.Deactivate
Command1.Caption = "Enable"
Label1 = "Disabled"
Case "Enable"
DirectSR1.Activate
Command1.Caption = "Disable"
Label1 = "Ready"
End Select
End Sub
The code is straight forward. A select case to test the caption of the button.
If Disable, Deactivate engine, set button caption to "Enable" and
set the label caption to "Disabled". If Enable, Activate engine, set
button caption to "Disable" and set the label caption to "Ready".
Remember, its label caption and button caption, two different things.
Related articles
Related discussion
-
VB6 Runtime error 381 subsript out of range Error
by Uncle (2 replies)
-
passing and reading parameters from using Shell
by jigartoliya (0 replies)
-
Convert C++ code to VB6
by mawcot (4 replies)
-
listbox scrollbar
by Dennijr (10 replies)
-
Can you describe Above simple VB6 code?
by pramodmca09 (0 replies)
Related podcasts
-
Christian Beauclair
14 mai 2008 (�mission #0074) ::.Christian Beauclair: Stratégies de migration VB6 vers .NET Nous discutons avec Christian Beauclair des stratégies de migration VB6 vers .NET. Entre autres, nous discutons comment utiliser le "VB 6 Code Advisor" et le "Interop Forms Toolkit" pour ajouter la puiss...
hi all...i am jitvinder from malaysia.. i am doing my final year project about speech recognition in basic arabic language..i need some help because i am nut familiariez with the steps in need to do to gain the output. please help. thanks.
!--removed tag-->hi i am Sandeep
I am doing a project on Speech recognition and my code is quite different from this one mentioned here...i would like to know one thing
I plan to extend the voice recognition capabilities of my software to actions performs inside an application as well. ( For. eg - Inside Microsoft word , if i say file , it should drop down the file tab)
Please give me suggestions on how to go about this....I am doin my project in VB 2005
Thanks...
hi...
i m working on speech recognition project ...can any one tell me .....is it possible to make this for dependent users by using sapi 5.1 kit and in C#.net 8?.....plz let me know this.........me very much worrying abut it....
lots of thanks.....
hello sr, i have been writing u from so many days , actually the problem exist becoz i am making the same project in vb.net , witch take diffrent parameters in phrase_finish function
can u plz send me all the codin vb.net , how do i use phrase in that
plz repl !
hello , i m isha
i encountered the same prob , it doesn't go in phrasefinish , did u solved it
i m working in VS 2003 n is making speech recog.
plz relpy
hello sir its me isha, i encountered the same problem that code in phrasefinish do not get executed,where to write the code as u were taking about, above form_load or where
plz help!
hello sir its isha i m working on speech reognition project i got a problem when i wrote your given code , i m using vb.net 2003, i got error with" grammerfromstring(totaldata)" event log says cannot open the method
i have sasdk1.5 installed , plz help what to do it gies error as" there is a problem with actibvelistenprojetlibdll"
plz help!
i would like to ask if any one could help me in my project,
i suppose to record real time with a user and while recording split the continious words into isolated words(split at the silence) so as to make recognition on the splited words
how could i so if using visual c++
thanks in advance
hello sir,
i have to create a voice recognition software (VB) which can controls my remote control car.The hand remote will be connected to the parallel port.Can u please give me ideas or even source code in how to activate the parallel port to control the RC car by voice commands (i.e. left,right,up,down,and stop).
sir its me again, can you also give me a source code of the speech recognition because i need so that i could simulate it, thank you sir! and God Bless!
hello sir i'm currently having a thesis on speech/voice recognition, my thesis is about enhancement viterbi algorithm in the application HMM (hidden marcov model) speech recognition, can you give a HMM speech recognition application because we are having a presentation in tuesday and our proffesor wants us to show this application and i cant find any application. i hope you could help me, thank you and god bless
hello sir i'm currently having a thesis on speech/voice recognition, my thesis is about enhancement viterbi algorithm in the application HMM (hidden marcov model) speech recognition, can you give a HMM speech recognition application because we are having a presentation in tuesday and our proffesor wants us to show this application and i cant find any application. i hope you could help me, thank you and god bless
Hello Sir,
Sincere thanks for your effort on the speech recognition project it really proved of great value to me. i am a student working on creating the same as my project. I only wish to operate different peripherals such as- printer, scanner, modems, web cameras on the voice commands along with an added feature of security. If u could only shed some light on my how to interface these in VB, i would be really be obliged.
Looking forward to your response
Thank you
You have not specified that on which technology you are working, if you wnat to develop your poject in VB 6.0 or .NET, in my opinion go for a good third party tool, one exelent tool os Exceletele Teletools V 3.0 and above, just search on google about this tool, its very easy to use and provides all functionalities related to Integrated Voice Responce System development.
GMike
"I would love to change the world, but they won't give me the source code."
hii..
plz i want program voice recognition by AI to help me in last year project ,my project is teaching all languages by computer automatically by talk in mic and computer auto corrects wrong plz send me any vode or tutorial that's help me thanx,.
i dont know how these forums work. Now people need help about STT and a guy among us says that he has done it but he is not extending any help, instead, he is demanding help about another topic. So please if anyone knows anything about the problem do share it coz we have to work our problems out with mutual cooperation .
hi
i'm swetha
i'm doing a project related to voice to text conversion..u hav written tht even u r interested in it .. so can u help me by providing some of the materials & links .
Thank u
hi sir ,
i am working on a project on speech to text conversion software,
as my final year project. plz send me the source code of the project and any other related tutorials.
plz reply as soon as possible......
my email id: beyondurthoughts200@yahoo.com
hai sri
This is satish ,i have already send a message to you but you donot give the answer for my error.
I have found an error while doing the speech recognization code that have been given by you.
My doubt is my operting system is win98.Is the speech recognization controls do not support for my operating system.
And also after installing the speech recognition the audio devices stops working why this was hapen.
Sir,i request to clear my doubts very clearly.Because after seeing
your website i showed a lot of interest in this topic.And my alternative email address is dec25sai@yahoo.co.in.I am waiting for your answers
byeeeee.
I am planning to do speech - to - text conversion as a part of my project using a FPGA ..
I am thinking of Vertibi or HMM algos ...
Can anyone tell me how do i continue and send me some links for a better knowledge on this area ... !!
Thank you
Is any one aware of software to perform a speech to text conversion and perform a spell-check in the process? I am trying to find this software to assist a special needs child with her ability to write school papers and emails.
Freeware would be great... a nominal fee would be good, too.
Forgot to say thanks in advance...
hi praveen,
i want to know how to convert from speech to text
pls reply
ok bye
Hi
Can anyone please share how to do speech to text conversion using C#.NET
Thanks in Advance
Prateek
Hello Alex,
I am trying to Recognize the voice coming from a phone line (Voice Modem connected to the machine) but i am unable to achive the same.
Note: My application is working well when i tried same using the mic (microphone)
Please suggest.
Thanks,
Yogesh
Refer the link below & to follow every of the step mentioned carefully
http://www.developerfusion.co.uk/show/1910/1/
It has to work !!!!
Thanks Alex. Your program & explaination helped a lot.
Hello,
I am trying the Speech/Voice Recognition. Tried everything what ever stated on the link "http://www.developerfusion.co.uk/show/1598/2/" but its not working.
How can i ensure
I am not able to hit (used Breakpoints) the following events as well
DirectSR1PhraseStart
DirectSR1PhraseFinish
The code on Form_Load() ....
DirectSR1.GrammarFromFile App.Path & "\SpeechFile.txt"
DirectSR1.Activate
The content of SpeechFile.txt .......
[<Start>]
<start>=Memo
<start>=Sound
<start>=New Media
<start>=Music
Hello,
Can you post your code for me to study as i am trying voice recognation but its not working at my end.
Thanks -- Yogesh
hello
i have finally made it. i include grammer file vcrVoice.GrammarFromFile "c:\grammer.txt"
and now it works fine.
Hello,
I am trying the same. Tried everything what ever stated on the link "http://www.developerfusion.co.uk/show/1598/2/" but its not working.
Hope you can help me.
Thanks,
Yogesh
Hello,
Please refer the URL as stated below.
I am trying the same. Tried everything what ever stated on the link "http://www.developerfusion.co.uk/show/1598/2/" but its not working.
Hope you can help me.
Thanks,
Yogesh
Hello,
I am trying the same. Tried everything what ever stated on the link "http://www.developerfusion.co.uk/show/1598/2/" but its not working.
Hope you can help me.
Thanks,
Yogesh
hello
i am doing voice recognation. it works fine but i want to insert grammer from file. can anyone give me example how to insert it.
Hello,
I need to convert Voice to Text for my project.
Could you please help me with some sample source-code
or any other relevant information for the same.
Looking forward for your email..
Thanks & Regards
Can anyone please share how to do speech to text conversion using C#.NET
Thanks in Advance
Prateek
in this link you see a sample:
This article shows you how to build speech recognition application using C#.
www.c-sharpcorner.com/ Code/2004/May/SpeechRecognition.asp
you have change the words for any numbers 0-100 and run the program it`s easy.
AOA!
i find your message at develper fusion of the date Oct' 2004. i am also doing speech recognition project using C#. i have done text to speech, speech to text. but i want to identify how is (person) speecking by identifing him thorugh speech samples in the database in C#.net. if you have any material then reply.
thanks
sajid from wah.
hi praveen,
i want to know how to convert from speech to text
pls reply
ok bye
Is there any way I can get a copy of your code? I am new to programming and to speech recognition and whatever help I can get is welcome.
Thank you.
Carlos
Did you ever get help on this subject? If you did, could you forward it to me? My email is cjquintero@comcast.net.
Thanks,
Carlos
i am pihu
i just visited this site and found out that u r working on speech to text conversion.
so please help me with the related sites,any material u can provide.i will be really grateful to u
pihu
Hi, I try to use a String as a word to say but when I try to code, the program start the explorer with the VB directory in place of the real Program. There no errors in the Select Case but I think that VB doesn't use the DSR technologies as it suppose to do...
There is my code, I use words in english and french, so it's sometime a little weird:
'define configuration
'[Grammer], set language to French-1036 (1036 don't work so it's set to English-1033)
'[<Start>], define the words we are looking for
totaldata = "[Grammar]" & vbCrLf & _
"langid = 1033" & vbCrLf & _
"type=cfg" & vbCrLf & _
"[<Start>]" & vbCrLf & _
"<start>=Notepad" & vbCrLf & _
"<start>=Volume" & vbCrLf & _
"<start>=Media Player" & vbCrLf & _
"<start>=Solitaire" & vbCrLf & _
"<start>=Desactiver" & vbCrLf & _
"<start>=" & opt1 & vbCrLf & _
"<start>= Thank You" & vbCrLf & _
"<start>=Close" & vbCrLf
DsrTest.GrammarFromString (totaldata)
The opt1 thing is a String referred to a Text Box to make a choice of applications, it's the only thing left before I can release my program on the web...
Do you add the Private Declare about the Shell Execute?
This is the code, it must be inseted under the Option Explicit option in the General Declarations:
Private Declare Function ShellExecute Lib "shell32.dll" _
Alias "ShellExecuteA" (ByVal hwnd As Long, ByVal _
lpOperation As String, ByVal lpFile As String, ByVal _
lpParameters As String, ByVal lpDirectory As String, _
ByVal nShowCmd As Long) As Long
hi, i am from mexico, and i am doing a project for my thesis, so i need information of voice recognition, please send me a sample of you project ok.
thanks
seidig01@yahoo.com.mx
Thank you in advance.
hello
i am from india ,i am doing my final year project in voice recognition(vb),so please send the project,and also send the source and the help file to my email id:vtheivamani@yahoo.com
nutter1_518_373@hotmail.com
I Keep On Getting This ^ Error
hjgj
hjgj
Indeed. This technology you're talking about is quite a challenge to even professionals. Try getting micrsoft's SDK and see for yourself what Notepad can do.
I just found this info. Hope it helps!
The method you're trying to use requires two parameters, the first one is the hWnd of the container form, and the second one is the intended title of the dialogue window.
To use this method, you MUST FIRST SET THE SPEAKER. To do this, store a string containing the speaker's name into the speech control's "Speaker" property.
'Note: sr is a DirectSR
sr.Speaker = "myName" 'This is the most important step
sr.TrainGeneralDlg sr.Parent.hWnd, "Welcome to Training"
Then the dialogue will display properly with the speaker as "myName." If this is the first time myName trained, then a new profile will be created for myName; otherwise an existing profile is loaded.
If you have any questions, just post another reply
Hello,
I need to convert Voice to Text as a part of my project.
Could you please help me with some sample source-code
or any other relevant information for the same.
Looking forward for ur email..
Thanks & Regards,
Vasanthi
Can somebody help me out with the following problem I am facing in my VB application. I am using Microsoft's Direct Speech Recognition Control.
I want to unload the current form, Form1, when i speak the phrase "exit".
In the phrasefinish event I have given:
If phrase="exit" then Unload Me.
In the Unload event of the form I have given:
DirectSR1.deactivate
Set Form1=Nothing ' to call the terminate event of the form
If i call the unload event from a command button, the code works perfectly and the form's unload and terminate event is called.
The problem occurs in the phrasefinish event of DirectSR1. "Exit" phrase is detected in the phrasefinish event, and the form's unload event occurs when I give Unload Me, but the terminate event of the form is not called and so my application hangs.
I have tried but I can't find a solution. I'd be most grateful if somebody could please help me out. This is a relevant part to my application and it is incomplete without it.
I am working on a project and am using the Microsoft Direct Speech Recognition component in VB6.
The problem I am facing is that when I give DirectSr1.TrainGeneralDlg I get the error:
Method 'TrainGeneralDlg' of object 'IDirectSR' failed.
If I use the Voice Command component and give VCommand1.TrainGeneralDlg, it works and the training screen comes.
Please tell me how i get the training screen to come on when using the Microsoft Direct Speech Recognition component.
I am using VB6 and WinXP. The problem also persists in Win98. The speech recognition engine is the one available on the Microsoft Agent download page for end-users. Please help me, I need the answer quickly.
Thank you.
hey
can anyone please help me how to do speech recognition for linux
Yes it can recognize any unecessary sounds like any sound that the computer may here.......
Maybe that's the problem because in voice recognition it should be quite to recognize waht you were saying.....
Hope it help you out....
Hi there!!!
About the voice recognition etc....
Anyway what do you really want to do???
Please make it more clear....
I want to convert speech to text, like kinda stuff........ its hard to explain....
its like this, I want my program to write everything I say, just like typing without using hands.... you know wahat I mean.
Please help me out with this.....
Any idea would be most appreciated.....
(Sorry for my english and explanation....
I'm interested on Voice recognition, actually I'm looking for a sample source code to help me out.
Please send me a sample at oendwight0829@myway.com......
Your help will be most appreciated....
Hi,
I am developing a speech recognition in VB and i need ur help to develop this speech recognition for our ERP application.
We want to consider ur code as an Example and we want to proceed further,
so can I have ur code please.
mail me to arunvv@yahoo.com,
Thanks
Arun
this is mahesh , i have a problem when printing document, i want to stop ejecting the paper (printer Object)
hi
thanks for helping me out till now.
i'm searching for the source code to recognise the object using the we camera .
is there any way for that
plz
waiting for your reply
respected sir
can u help me , how to use the grammer.txt file .
and how can i dynamically add words to grammer.
can u help me . can u get me the code.
email: seshutou@hotmail.com
thanking you
Hello everyone, I have already posted this email elsewhere on this site, but I didn't place it under speech recognition.
I have found an alternative, and better, solution to speech recognition. Instead of using the "Microsoft Direct Speech Recognition" activex control, you would use the "Microsoft Speech Object Library" reference.
First, make sure that the Microsoft Speech Recognition 5.1 & 4.0 SDK's are installed on your machine. Both 5.1 and 4.0 are needed due to a missing file in 5.1.
Once this is done start Visual Basic Standard EXE mode. Under the Project menu, select References. Scroll down until you see "Microsoft Speech Object Library" and check the box next to it.
Now, double click on the blank form to bring up the code window. Select everything and paste the following code. (you have to select everything already in the code window or you will create a duplicate Form_Load procedure and get an error)
Dim WithEvents RecoSpeech As SpSharedRecoContext
Dim Grammar As ISpeechRecoGrammar
Dim TopRule As ISpeechGrammarRule
Dim Voice As New SpVoice
Private Sub Form_Load()
Set RecoSpeech = New SpSharedRecoContext
Set Grammar = RecoSpeech.CreateGrammar(12)
Set TopRule = Grammar.Rules.Add("TopRule", SRATopLevel Or SRADynamic, 1)
TopRule.InitialState.AddWordTransition Nothing, "hello computer"
Grammar.Rules.Commit
Grammar.CmdSetRuleState "TopRule", SGDSActive
End Sub
Private Sub RecoSpeech_Recognition(ByVal StreamNumber As Long, ByVal StreamPosition As Variant, ByVal RecognitionType As SpeechLib.SpeechRecognitionType, ByVal Result As SpeechLib.ISpeechRecoResult)
Dim Phrase As String
Phrase = LCase(Result.PhraseInfo.GetText)
If Phrase = "hello computer" Then Voice.Speak "hello"
End Sub
This code will work "as is". Just run the program and say "hello computer" into your microphone and your computer should respond hello.
Hope this helps everyone. Please feel free to email me with any questions or comments at Prowler222@Hotmail.com or OASISPlayground@Hotmail.com
Thanks,
Eric Haensgen (aka - ProgramGod)
Dark Mountain Software - President
The following is a quick example of how Grammar.txt should look:
[<start>]
<start> this is only a test 'this is what vb will recognize if this is all that you say (meaning nothing before it and nothing after it)
<start> ... patient records -- this will give you the ability to add a word before (ie - open patient records), but only "patient records" will be recognized by vb.
<start> ... patient record <digits> -- this gives you the ability to add a word before but also lets you specify a number after. (numbers have to be preprogrammed as well
<start> one
<start> two
<start> you get the point
Hope this was helpful. Please email me at OASISPlayground@hotmail.com
Thanks,
Eric
President OASISPlayground
For all of those interested in how to make speech recognition to work in Win2k & XP follow these steps:
1) Download and install Microsofts Speech Recognition 5.1 SDK
2) Download and install Microsofts Speech Recognition 4.0 SDK (Suite or regular)
3) Add the following lines to Form_Load()
DirectSR1.GrammarFromFile "grammar.txt"
DirectSR1.Activate
4) Add the following lines to DirectSR1_PhraseFinish(..., Phrase as String)
if lcase(Phrase) = "this is only a test" then msgbox "Speech was recognized"
5) Start notepad and type the following:
[<start>]
<start>=this is only a test
6) Save the file as GRAMMAR.TXT in your VB directory (ie - C:\Program File\Microsoft Visual Studio\VB98)
Once you have created your program the obvious rules apply for where to put GRAMMAR.TXT
If you just specified GrammarFileFrom "GRAMMAR.TXT" then you must put the grammar file in the path in which your program is being executed
Other wise you must specify a path for the grammar file (if different from the application path) (ie - DirectSR1.GrammarFromFile "C:\GRAMMAR.TXT")
Hope this helps. If you have any questions, please feel free to email me at Prowler222@Hotmail.com.
hai sri
This is satish ,i have already send a message to you but you donot give the answer for my error.
I have found an error while doing the speech recognization code that have been given by you.
My doubt is my operting system is win98.Is the speech recognization controls do not support for my operating system.
And also after installing the speech recognition the audio devices stops working why this was hapen.
Sir,i request to clear my doubts very clearly.Because after seeing
your website i showed a lot of interest in this topic.And my alternative email address is dec25sai@yahoo.co.in.I am waiting for your answers
byeeeee.
Hai Sir
I am very happy for your help regarding this speech regonization
But even i sell Yourname it is not saying Hello Youname.Please give me a solution for this.
Thankin you,
from
satish
I am very happy for your help regarding this speech regonization
But even i sell Yourname it is not saying Hello Youname.Please give me a solution for this.
Thankin you,
from
satish
I ve a prob with DirectSR.GrammarFromFile.
What is its structure. Please give me a file example.
I think there’s a slight error in the example though (which is the cause of the error: Method "Activate" of object "IDirectSR" failed)
The caption for command button 1 shouldn’t be [enable] by default, it should be [disable]. DirectSR1 is already activated on form load. (I think).
Seemed to work ok (once I worked out what was causing the above error), but it doesn’t seem very accurate. For example, “Ballyooob” in a muffled voice is recognised as “Volume” etc. Is this the engine or something else?
Is it possible to use the speech recognition engine that comes with Office XP? (Or is this one just as good?).
Thanks again
Hello Sir,
i tried the codes but i keep gettin this message
Method " Activate" of object "IDirectSR" failed
could this be a hardware problem as i am using a computer 233MHz and 128RAM where else speech recognition requires 400MHz comp with 128MB RAM....i hope you will be able to clear my doubt.
thank you
just wondering...have u found code to let you choose between the sound cards?
i've been having exactly the same problem, plus one other
i have an onboard card, as well as a creative sb live. what i'm looking for tho is code that not only lets me switch between the two cards, but also something that will let me dynamically manipulate the sound banks and sound fonts on the creative sb live card.
if you find, or have found, something, then please do let me know!
thanks
-nash
The code worked fine for me.
Great infact.
Was easy to read and follow. A Gold-mine of a find.
Thanks a bunch Mr. Yung.
My problem was dealing with multiple soundcards.
I use the onboard Sound "card" for Voice IN/Out while my PCI SB Live 5.1 for everything else.
I'm still looking for help coding VB to allow me to choose which soundcard to use though... if anyone knows, please share a link with me.
I'm splitting the mic line so I can have a 2nd mic hidden by the front door. When I walk in the house, I can speak a command (currently "Ahem") and the hallway speakers will start playing the "Imperial March" from Star Wars while I walk to my room. I feel so evil.
-/\/\egalomanic
I have been having trouble with getting this software to work on other computers. I used the above example and had it working on a WinME computer, but I have packaged the software and sent it to test on other computers, and it did not work in any cases (definately for XP). Has anyone else had this problem- and does anyone know what I might need to do differently? thanks
Thank you in advance
Can anyone help me start with a simple voice application using VS.NET speech controls?? Thanks for your time.
Are any of uyou using win xp pro?
cause I am and I don´t get it to work
it will be very helpful for me if i get the codes you have done to recogonise speech in vb and interpret command like calculator.
from santosh
I too am having problems with the code in the tutorial. I copied all the code, and nothing happend. I read another post about doing "directsr1.countEngines()" and got 1. I reinstalled the Actcnc.exe anyway. Now I get a error runtime error "Method 'Activate' of object 'IDirectSR' Failed".
Has anyone else had this problem or does anyone have a solution for these issues?
Thanks,,
Payneb
yupp
got the same problem any solution yet??
I don't remember much about it, but do have a general troubleshooting suggestion that worked for me. Got to google and type in the error message, and look at the search results. Usually someone else had the same problem and solved it.
Has anyone else had this problem or does anyone have a solution for these issues?
Thanks,,
Payneb
Please contact me on mmnjha@rediffmail.com.I need some help and I can be helpful to you.
mukund mohan
Hi there, who can help me in speech recognition? I am beginner in this speech recognition field. I would like to know how can I read or get the text that recognise from the speech to text. and the text can be read and send to parallel port? For example, i hv the via voice IBM application, how can I get the text and send it to parallel port? If using window base... how it is done? Anyone who can help me? Thanks!
regards, lyli_my
Hi Rohan,
I have used the above code it is same as given in the site i think when u spell the words Line Notepad Volume
u need to spell the like Note paad Vawlume ,another thing would be u also have to donwload
Microsoft Speech Recognition Engine
http://www.microsoft.com/products/msagent/downloads.htm#sr
It is working fine at my side
i am also able to open calculator
Cheers Rahul
plzzz reply and my email id is smithx@rediffmail.com
ciao and take care
if any information plzz pass it on
sumit
i m a final yr be computer engineering student and am expected to do the project ...ie develop the software for it but have no idea....
plzzz help.....
sumit
so I reinstalled actcnc and it then came up with 1, and the program ran.
The speech recogniton sample in VB did not work for me either.
It compiles fine, but nothing happens after I click the enable or disable.
It appears that the code never gets to the phrasefinished() procedure
Another post suggested adding
engine = DirectSR1.Find("MfgName=Microsoft")
DirectSR1.Select engine
But that causes a crash on "Method of find fails"
Did anyone get it to work?
What is missing?
i am trying to recongise crying sound...
is it possible to change the code to suit my application...
thanks alot
talotalobosza
would like to ask for some help regarding making such speech recognition software.
if anyone can help...pls do email me at:
arvin_tina@yahoo.com
i will be making a thesis right now...and i ...
r u still in the project?
I may try a help
add this before you activate the DirectSR1:
dim engine
engine = DirectSR1.Find("MfgName=Microsoft")
DirectSR1.Select engine
Mr. Yung forgot to select the speech recognition engine into the control.....
Regards.
Hello, I am trying to develop an Email system that enables the blind people to use. The user will translate voice to text, and then activate the buttons to send the email. When receive email, the system will be able to convert text to voice....Please advice. Thank you!
dear sir,
i want to know about grammer in speech recognition in vb in more detail
and interaction with sound card.how it is connect with soundcard ,in vb we just create cfg grammer but i want all detail with hardware
plese help me and send me mail at "pradippm@yahoo.com"
thanks
Hi There
i had The Same Problem
and i fixed it by donloading the Speech Engine From Microsoft and install it
i think you have the same problem
download the Engine setup file It's 6.1 MB
Download From here
and install it
tada your problem is fixed
Have Fun And Email Me
Prince of Dark
a_z5@hotmail.com
I'm interested in spanish language recognition. Can someone help me?
Thanks
Nobody know the answer to this question????
Can somebody please help me out here.. I'm kind of stuck...
I changed my code in the form_load procedure, but it stil isn't working properly.
VB is complaining about the ' DirectSR1.AboutDlg hwnd, "test" ' line.
It doesn't seem to go with the 'hwnd' value.
Can somebody please tell me what I should put here instead?
Thanks.
I am not getting the out put So can Any one help Me..
Cheers
hello everyone... i'm in need of speech recognition and fuzzy speech recognition source code. does anybody have the source code
and would kindly share it with me..or does anybody know how to get the source codes? it's really urgent.. somebody please help me.. thank you.
hello... does anybody have source codes in any language on speech recognition and fuzzy speech recognition???!!
please help me..i'm in an urgent situation here!!!!
hi
the program works! that's great.
i still have some questions to ask, please reply me here or send me an email.
1) can the engine recognise the meaningless sound like um, ar, oh?
2) I know I can set my own grammar list for my application, but i am not sure that can I put these um, oh sound into it.
3) if it can , how to set the grammar list?
thanks
P.S
it's quite urgent, please reply me as soon as possible. thanks a lot!
Sincerely,
cherry
hi,
the notepad, media player and volume cannot be opened. can anyone help?
P.S. i would like to ask wether this engine can recognise some meaningless sound, like o, ai, um?
thanks
cherry
I added the following line to the form;
DirectSR1.AboutDlg hwnd, "test" but I got the following
run time error 430
Class does not support Automation or does not support expected interface
OK, Duh,, Never mind all..lol. But Now that I have it working, and Have the ms speech installed. It dosent do anything. It opens up now, but I dosent hear anything I say to it. When I click the button should something happen?
What am I missing here. When I try to run the program I get this error.
"Only comments may appear after end sub end function or end property."
Then this line of code is highlighted. This is in the form load section of the program.
Private Declare Function ShellExecute Lib "shell32.dll" _
Alias "ShellExecuteA" (ByVal hwnd As Long, ByVal _
lpOperation As String, ByVal lpFile As String, ByVal _
lpParameters As String, ByVal lpDirectory As String, _
ByVal nShowCmd As Long) As Long
Varible not found its pointing to this in code: Label1 = "Disabled"
i need help on how to create a dictation device in vb
a good user interface to match it
how do i expand the john yung's voice command program to match my desires
it's urgent
thanks
felix
DirectSR1.GrammarFromFile App.Path & "\grammer.txt"
Alex
I got it to respond and talk back to me using the microsoft agent.
I did some research and found some codes and downloaded one of the agent.
It is pretty cool.
-----------------------------------
I had one more question. I am addting too many commands
i mean "<start>=Name RC" & vbCrLf & _
and now when i try to add one more, VB gives me a error reading
"Too Many Line Continuations"
and it does not let me add anymore of those start.
Is there a way that i could read it from a file or if i can make two lines and use them both to recognise the word?
Let me know...thanks
Pahtik
Download the text-to-speech engine at http://activex.microsoft.com/activex/controls/sapi/spchapi.exe. (It wont take to long). Then open up visual basic and add the microsoft direct text-to-speech control to the toolbox and then on the form.
You can make it say anything but this code makes it say "Hello. This is the computer speaking".
DirectSR1.Speak "Hello. This is the computer speaking."
This should work for any text. Any problems contact me at amyalano@netscapeonline.co.uk
Pathik,
I would have to say to contact Microsoft on your questions. As you are well aware this technology is so new to the mainstream market that no know I have found knows too much about it. I did a project recently for a VB class and wanted to create a program for my son to play with using speech recognition and also to give him feedback. The way that I did it was to create a whole bunch of wav files from the "Sound Recorder" on your Windows OS. Then populate the words from the code that I posted and tweak it to do what you want it to do. For example, instead of opening up "Notepad" like the example does, just play a specific wav file if the user says a word that is native to your program.
However, I have to warn you that by creating a program that will listen and respond to the user, then perform a desired action is pretty tough. Because what happens is the computer hears itself talk from the speakers, then it wants to respond, as it supposed to. Let me know whether or not that is clear. The bottom line is that you need to be able activate and deactivate the DSR when necessary without using a command button. If you figure that out, then please let me know.
To play the sound files, you will need to add a module with the following code:
'*********************
'This is the function that will play the sound files.
Public Declare Function sndPlaySound Lib "winmm" Alias "sndPlaySoundA" _
(ByVal lpszSoundName As String, ByVal uFlags As Long) As Long
Public Sub PlaySound(strFileName As String)
'This sub routine is required along with the above function
sndPlaySound strFileName, 1
End Sub
'*******************
Put this in your forms:
'*******************
This code will play the wav file from your form:
Private Sub Command1_Click()
PlaySound (App.Path & "/HereWeGo.wav")
End Sub
'********************
Good luck!
Regards,
Vince Randazzo
This was a good piece of Code.
Can i ask u some question if possible please reply back here and at web@shahpathik.com
1) Is there a tutorial for this speech recognition (like a book or a web page dedicated to that)
2) Can u teach us how the computer can talk back to us (ex if we saw a word instead of it showing that it has matched in the Labal1, if it would actually say the word back to us that could be great, text to voice.)
3) If i want to use the Speech to text and want to actually type few lines in a text box within visual basic, how do we do that?
I am sorry, i know i have asked many questions, but this tutorial has really amazed me and i want to explorer it more.
So i hope u can help me with the above matter and teach us more about voice recognition.
Thanks a lot
Pathik
'Just copy and paste this, but don't forget to download the correct
'"speech recognition engine" at the following address:
'http://www.microsoft.com/products/msagent/downloads.htm#core.
'This file is approximately 6MB, so go get it!
'If you don't get the correct engine, then this code will not work...
'Good luck!
Option Explicit
Private Declare Function ShellExecute Lib "shell32.dll" _
Alias "ShellExecuteA" (ByVal hwnd As Long, ByVal _
lpOperation As String, ByVal lpFile As String, ByVal _
lpParameters As String, ByVal lpDirectory As String, _
ByVal nShowCmd As Long) As Long
Private Sub Command1_Click()
Select Case Command1.Caption
Case "Disable"
DirectSR1.Deactivate
Command1.Caption = "Enable"
Label1 = "Disabled"
Case "Enable"
DirectSR1.Activate
Command1.Caption = "Disable"
Label1 = "Ready"
End Select
End Sub
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)
Dim sFile As String
Dim noth As Long
Select Case Phrase
Case "Notepad"
sFile = "\system32\notepad.exe"
noth = ShellExecute(0, "OPEN", Environ("SystemRoot") & sFile, "", "", 1)
Case "Volume"
sFile = "\system32\sndvol32.exe"
noth = ShellExecute(0, "OPEN", Environ("SystemRoot") & sFile, "", "", 1)
Case "Media Player"
sFile = "C:\Program Files\Windows Media Player\wmplayer.exe"
noth = ShellExecute(0, "OPEN", sFile, "", "", 1)
End Select
If Phrase <> "" Then
Label1.Caption = "Matched word is " & Phrase
Else
Label1.Caption = "No word matched"
End If
End Sub
Private Sub Form_Load()
Dim totaldata As String
totaldata = "[Grammar]" & vbCrLf & _
"langid = 1033" & vbCrLf & _
"type=cfg" & vbCrLf & _
"[<Start>]" & vbCrLf & _
"<start>=Notepad" & vbCrLf & _
"<start>=Volume" & vbCrLf & _
"<start>=Media Player" & vbCrLf
DirectSR1.GrammarFromString (totaldata)
DirectSR1.AboutDlg hwnd, "test"
End Sub
You will need to try playing around with the speech recognition settings.... Speech recognition is never 100% perfect...
When I run the program,Only media player responds to the command...
Thanks for your reply .. i will try the admendment - the only thing that puzzled me is that when talking into mic i put a breakpoint into the phrase finish and it never got to it .. i would of assumed it would of hit this bp?
anyhow i will try the amended code and reply if i have trouble.
My apologies for the problems with this article. They have now been corrected. In order to get your code to work, please make the following changes:
1) Change the caption of Command1 to 'Enable'
2) Change the code in Form_Load to
Dim totaldata As String
totaldata = "[Grammar]" & vbCrLf & _
"langid = 1033" & vbCrLf & _
"type=cfg" & vbCrLf & _
"[<Start>]" & vbCrLf & _
"<start>=Notepad" & vbCrLf & _
"<start>=Volume" & vbCrLf & _
"<start>=Media Player" & vbCrLf
DirectSR1.GrammarFromString (totaldata)
DirectSR1.AboutDlg hwnd, "test"
My apologies for the problems with this article. They have now been corrected. In order to get your code to work, please make the following changes:
1) Change the caption of Command1 to 'Enable'
2) Change the code in Form_Load to
Dim totaldata As String
totaldata = "[Grammar]" & vbCrLf & _
"langid = 1033" & vbCrLf & _
"type=cfg" & vbCrLf & _
"[<Start>]" & vbCrLf & _
"<start>=Notepad" & vbCrLf & _
"<start>=Volume" & vbCrLf & _
"<start>=Media Player" & vbCrLf
DirectSR1.GrammarFromString (totaldata)
DirectSR1.AboutDlg hwnd, "test"
My apologies for the problems with this article. They have now been corrected. In order to get your code to work, please make the following changes:
1) Change the caption of Command1 to 'Enable'
2) Change the code in Form_Load to
Dim totaldata As String
totaldata = "[Grammar]" & vbCrLf & _
"langid = 1033" & vbCrLf & _
"type=cfg" & vbCrLf & _
"[<Start>]" & vbCrLf & _
"<start>=Notepad" & vbCrLf & _
"<start>=Volume" & vbCrLf & _
"<start>=Media Player" & vbCrLf
DirectSR1.GrammarFromString (totaldata)
DirectSR1.AboutDlg hwnd, "test"
-Jordan
Which leads to:
http://www.microsoft.com/products/msagent/downloads.htm#core
Which leads to the file:
http://activex.microsoft.com/activex/controls/agent2/actcnc.exe
Hope that helps :-)
Dave.
It was mentioned at the start of the article but the link only went to the SDK page, nothing there about the speech engine (or I missed it). Eventually figured it out, lol :-)
Dave.
I'm using Visual studio 6.0 with SP5
Any help would be appreciated.
Dave.
This thread is for discussions of Speech Recognition.