Members

Technology Zones

IBM Learning Center

Articles

Hosted By

MaximumASP

Info

Rated
Read 85,170 times

Contents

Downloads

Related Categories

Using Speech Recognition and Text to Speech - Hello Computer!

alexreg

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!

Currently programs in VB, QBasic, ASP, PHP, SQL, HTML, CSS, VBScript and some Java/JavaScript. Learning VB.NET.

Comments

  • Re: [1989] Using Speech Recognition and Text to Speech

    Posted by Amsakanna on 14 Aug 2007

    hi,


            me from INDIA..... wanna know abt speech recog vb soft..... tell me how to successfully run that....... i've problem with that line ["grammar"...

  • Re: [1989] it doesn't work.

    Posted by Intermedia on 13 Dec 2006

    When the application is started and clicked the enable button error occurs.

    Run-time error '-2147220456 (80040418)':
    Automation error

    Please reply.

  • Re: it doesn't work for me!

    Posted by triac56 on 20 Nov 2006

    [quote user="Einord"]I'm running VB 6.0 and XP... Everything is properly installed and so on, but i can't hear the computer speak...

    What can I do?[/quote]

  • Speech Recogintion

    Posted by kalairaj on 03 Nov 2005

    I read ur tutorials and used in VB. But my project is not work. my voice is not recognised and phrase_finish event is not run.

    Please explain the following code in ur tutorial.



    SpeechGramme...

  • sorry but i need help

    Posted by scifer on 23 Oct 2005

    :confused: i am sorry but this progy is not working for me i have all d/l and i have the mic on, the seakers on too i scaned the things i typed and stell the samething it wont work for me i also tryed...