Click here to Skip to main content
14,603,917 members

A Simple Speech Application Using SAPI 5.1 SDK

Rate this:
3.24 (24 votes)
Please Sign up or sign in to vote.
3.24 (24 votes)
3 Oct 2004
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

Share

About the Author

chakkaradeepcc
Software Developer
New Zealand New Zealand
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

Comments and Discussions

 
Generaladd own grammar lib Pin
TassadaqHussain16-Sep-05 10:52
MemberTassadaqHussain16-Sep-05 10:52 
Generalvoice recognition Pin
TassadaqHussain14-Sep-05 8:07
MemberTassadaqHussain14-Sep-05 8:07 
GeneralRe: voice recognition Pin
soumyasantadas29-Sep-07 16:59
Membersoumyasantadas29-Sep-07 16:59 
GeneralRe: voice recognition Pin
TassadaqHussain29-Sep-07 23:08
MemberTassadaqHussain29-Sep-07 23:08 
Generalspeech to text Pin
Cheeeeema17-Aug-05 10:13
sussCheeeeema17-Aug-05 10:13 
GeneralRe: speech to text Pin
chakkaradeepcc25-Aug-05 2:53
Memberchakkaradeepcc25-Aug-05 2:53 
GeneralRegarding "sphelper.h' Pin
chakkaradeepcc23-May-05 2:34
Memberchakkaradeepcc23-May-05 2:34 
GeneralRe: Regarding "sphelper.h' Pin
mikkojay23-Feb-09 14:38
Membermikkojay23-Feb-09 14:38 
I can appreciate that, but I have been searching google, MS, etc and all 5.1 sdk links are dead.
Thanks
GeneralRe: Regarding "sphelper.h' Pin
khairul7863-May-11 17:42
Memberkhairul7863-May-11 17:42 
GeneralRelease Build Crashes Pin
Spoodles29-Nov-04 3:05
MemberSpoodles29-Nov-04 3:05 

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

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

Article
Posted 3 Oct 2004

Stats

204.9K views
39.3K downloads
75 bookmarked