Using Speech Recognition and Text to Speech

Hello Computer!

The next and final step is to add this code to the PhraseFinish event of vcrVoice. This will make the computer reply to what you have said.

Select Case Phrase
 	     Case Is = YOURNAME
 	         spkSpeak.Speak "Hello " & YOURNAME
 	     Case Is = "What year is it?"
 	         spkSpeak.Speak Year(Date)
 	 End Select

The program works like this, the grammer is set and the Speech Recognition control is activated. When you finish a phrase the control activates the PhraseFinish event and then there is a test to get what you said and reply to it.

If you run the program it and say your name (the value of the constant YOURNAME) it will say "Hello " and then your name. If you then say "What year is it?" it will reply "It is the year " and then the year. If it doesn't understand you the first time try, try and try again until you are sure it does not work. Also, this may sound silly but make sure your speakers are on otherwise you could think the program is not working when it is! This simple program can make you able to talk to the computer. You can then extend this program so you can even have a conversation with the computer!

You might also like...

Comments

Contribute

Why not write for us? Or you could submit an event or a user group in your area. Alternatively just tell us what you think!

Our tools

We've got automatic conversion tools to convert C# to VB.NET, VB.NET to C#. Also you can compress javascript and compress css and generate sql connection strings.

“The trouble with programmers is that you can never tell what a programmer is doing until it's too late.” - Seymour Cray