Click here to Skip to main content
Licence 
First Posted 3 Oct 2004
Views 132,193
Bookmarked 73 times

A Simple Speech Application Using SAPI 5.1 SDK

By | 3 Oct 2004 | Article
A simple speech application using SAPI 5.1 SDK.

Introduction

This small speech application converts text to speech and speech to text. If you choose the "Speak" option, whatever you type in the textbox is is converted to speech and you can hear the Microsoft's default voice speaking it out!

This application also converts speech to text. Just connect your microphone and do the "Microphone Setup" to set up your microphone and speak. You will be able to see the words get typed in the textbox as you speak!

For best results please do try the Voice Training Wizard before speaking out anything, it helps in setting your grammar.

Using the Code

The application is a dialog based application written in MFC. It uses only one dialog class CSpeechDlg.

The steps involved are as follows:

  1. Initialize COM.
  2. Initialize the Recognizer (to recognize that a speech is being invoked).
  3. Initialize the RecoEngine (the Speech engine).
  4. Initialize the RecoContext (the context in which we are going to write the speech application).
  5. Set a user-defined message that will grab whenever something is spoken, to our window (here dialog).
  6. Set the speech record interest in RECOGNITION Status.
  7. Create the default audio input.
  8. Set the Input to the speech engine.
  9. Specify the Grammar that we want to use (here we use Dictation Grammar).
  10. Load the Dictation Tool.

Speech To Text

The CallBack function for our user defined message will perform the following for the speech to text conversion:

  • It will process all the speech events.
  • Check for the event ID generated to identify the speech event that has occurred.
  • If it is the speech recognition event, then get the text and display it in the text area.

Text to Speech

This is a simple process, you just have to pass the text to a function Speak(text) and now the function will take care of its processing .

References

  • Microsoft Speech SDK 5.1.

Pre-Requisites

  • Microsoft Speech SDK 5.1 onwards.

My contact

Note

  • SAPI - Speech Application Programmer Interface.

License

This article has no explicit license attached to it but may contain usage terms in the article text or the download files themselves. If in doubt please contact the author via the discussion board below.

A list of licenses authors might use can be found here

About the Author

chakkaradeepcc

Software Developer

New Zealand New Zealand

Member

Chakkaradeep, known as Chaks to his friends, hails from the Indian subcontinent.Having done his Masters in Software Engineering, he knows his way around a computer and has sound knowledge of Microsoft technologies.
 
Chaks is currently working as a Microsoft Developer @ New Zealand.
 
You can reach him via his blog - http://chakkaradeep.wordpress.com

Sign Up to vote   Poor Excellent
Add a reason or comment to your vote: x
Votes of 3 or less require a comment

Comments and Discussions

 
You must Sign In to use this message board. (secure sign-in)
 
Search this forum  
 FAQ
    Noise  Layout  Per page   
  Refresh
QuestionA Simple Speech Application Using SAPI 5.1 SDK PinmemberHoaCat6:49 15 May '12  
QuestionHow to set LCID? PinmemberVaclav_Sal6:16 2 Nov '11  
GeneralError PinmemberMember 790868620:37 2 Jun '11  
GeneralMy vote of 3 PinmemberHuangQihua17:42 26 Apr '11  
Generalspeech recognition code Pinmembervambe william8:12 21 Mar '11  
GeneralRe: speech recognition code PinmemberHuangQihua17:38 26 Apr '11  
GeneralSpeech to text Pinmemberkanhaiyalal559010:53 11 Oct '10  
Generalreally i need hlp sos plz Pinmemberiamlina7:23 18 Aug '10  
Generalspeech to text conversion PinmemberBasudevkuet4:24 4 Jan '10  
Generalspeeh recognition project Pinmembervvkvinothkumar3:09 2 Jan '10  
Generalspeech to text Pinmembervishal_0512:39 17 Dec '09  
QuestionWhat about input from wav file ?? Pinmemberpantherab6:07 27 Nov '09  
GeneralVoicechat in Website PinmemberSelvaSR7:24 11 Aug '09  
Generalproblem in the code provided PinmemberAnuj Jain6:33 23 Mar '09  
GeneralRe: problem in the code provided PinmemberMember 597963021:05 29 Sep '09  
GeneralPlz From Voice2Text Using C# Pinmemberalmthnna7:20 21 Mar '09  
Generalvoice command in vb6 Pinmembernexxi benom3:02 29 Aug '07  
Generalsource code for tts Pinmemberzuwie17:56 28 Aug '07  
Questionspeech to text Pinmembersai_josna1620:22 7 Aug '07  
Generalspeech to text Pinmembersai_josna1620:16 7 Aug '07  
Generalspeech to text Pinmemberfetiya2:42 2 Apr '07  
Generalvoice2text using c# Pinmemberfetiya22:42 27 Mar '07  
GeneralError regarding text to speech convertion Pinmembervenkatttttttttttt3:00 19 Aug '06  
GeneralSpeech to text Pinmemberdamodarm21:20 10 Jul '06  
GeneralInitialize COM PinmemberZyx Valinjee10:15 15 Jun '06  

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.

Permalink | Advertise | Privacy | Mobile
Web01 | 2.5.120517.1 | Last Updated 3 Oct 2004
Article Copyright 2004 by chakkaradeepcc
Everything else Copyright © CodeProject, 1999-2012
Terms of Use
Layout: fixed | fluid