Click here to Skip to main content
12,243,721 members (52,665 online)
Click here to Skip to main content
Add your own
alternative version

Stats

174.1K views
38.2K downloads
75 bookmarked
Posted

A Simple Speech Application Using SAPI 5.1 SDK

, 3 Oct 2004
Rate this:
Please Sign up or sign in to vote.
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

You may also be interested in...

Comments and Discussions

 
Generalwhy? Pin
Me is Needer21-Jun-14 23:38
memberMe is Needer21-Jun-14 23:38 
QuestionMr.Chaks i really need your help Pin
Osai Orosco3-May-14 0:53
memberOsai Orosco3-May-14 0:53 
QuestionA Simple Speech Application Using SAPI 5.1 SDK Pin
HoaCat15-May-12 7:49
memberHoaCat15-May-12 7:49 
QuestionHow to set LCID? Pin
Vaclav_Sal2-Nov-11 7:16
memberVaclav_Sal2-Nov-11 7:16 
GeneralError Pin
Member 79086862-Jun-11 21:37
memberMember 79086862-Jun-11 21:37 
GeneralMy vote of 3 Pin
HuangQihua26-Apr-11 18:42
memberHuangQihua26-Apr-11 18:42 
Generalspeech recognition code Pin
vambe william21-Mar-11 9:12
membervambe william21-Mar-11 9:12 
GeneralRe: speech recognition code Pin
HuangQihua26-Apr-11 18:38
memberHuangQihua26-Apr-11 18:38 
GeneralSpeech to text Pin
kanhaiyalal559011-Oct-10 11:53
memberkanhaiyalal559011-Oct-10 11:53 
Generalreally i need hlp sos plz Pin
iamlina18-Aug-10 8:23
memberiamlina18-Aug-10 8:23 
Generalspeech to text conversion Pin
Basudevkuet4-Jan-10 5:24
memberBasudevkuet4-Jan-10 5:24 
Generalspeeh recognition project Pin
vvkvinothkumar2-Jan-10 4:09
membervvkvinothkumar2-Jan-10 4:09 
Generalspeech to text Pin
vishal_0517-Dec-09 13:39
membervishal_0517-Dec-09 13:39 
QuestionWhat about input from wav file ?? Pin
pantherab27-Nov-09 7:07
memberpantherab27-Nov-09 7:07 
GeneralVoicechat in Website Pin
SelvaSR11-Aug-09 8:24
memberSelvaSR11-Aug-09 8:24 
Generalproblem in the code provided Pin
Anuj Jain23-Mar-09 7:33
memberAnuj Jain23-Mar-09 7:33 
GeneralRe: problem in the code provided Pin
Member 597963029-Sep-09 22:05
memberMember 597963029-Sep-09 22:05 
GeneralPlz From Voice2Text Using C# Pin
almthnna21-Mar-09 8:20
memberalmthnna21-Mar-09 8:20 
Generalvoice command in vb6 Pin
nexxi benom29-Aug-07 4:02
membernexxi benom29-Aug-07 4:02 
Generalsource code for tts Pin
zuwie28-Aug-07 18:56
memberzuwie28-Aug-07 18:56 
Questionspeech to text Pin
sai_josna167-Aug-07 21:22
membersai_josna167-Aug-07 21:22 
Generalspeech to text Pin
sai_josna167-Aug-07 21:16
membersai_josna167-Aug-07 21:16 
Generalspeech to text Pin
fetiya2-Apr-07 3:42
memberfetiya2-Apr-07 3:42 
Generalvoice2text using c# Pin
fetiya27-Mar-07 23:42
memberfetiya27-Mar-07 23:42 
GeneralError regarding text to speech convertion Pin
venkatttttttttttt19-Aug-06 4:00
membervenkatttttttttttt19-Aug-06 4:00 
GeneralSpeech to text Pin
damodarm10-Jul-06 22:20
memberdamodarm10-Jul-06 22:20 
GeneralInitialize COM Pin
Zyx Valinjee15-Jun-06 11:15
memberZyx Valinjee15-Jun-06 11:15 
Generaladd own grammar lib Pin
TassadaqHussain16-Sep-05 11:52
memberTassadaqHussain16-Sep-05 11:52 
Generalvoice recognition Pin
TassadaqHussain14-Sep-05 9:07
memberTassadaqHussain14-Sep-05 9:07 
GeneralRe: voice recognition Pin
soumyasantadas29-Sep-07 17:59
membersoumyasantadas29-Sep-07 17:59 
GeneralRe: voice recognition Pin
TassadaqHussain30-Sep-07 0:08
memberTassadaqHussain30-Sep-07 0:08 
Generalspeech to text Pin
Cheeeeema17-Aug-05 11:13
sussCheeeeema17-Aug-05 11:13 
GeneralRe: speech to text Pin
chakkaradeepcc25-Aug-05 3:53
memberchakkaradeepcc25-Aug-05 3:53 
GeneralRegarding "sphelper.h' Pin
chakkaradeepcc23-May-05 3:34
memberchakkaradeepcc23-May-05 3:34 
GeneralRe: Regarding "sphelper.h' Pin
mikkojay23-Feb-09 15:38
membermikkojay23-Feb-09 15:38 
GeneralRe: Regarding "sphelper.h' Pin
khairul7863-May-11 18:42
memberkhairul7863-May-11 18:42 
GeneralRelease Build Crashes Pin
Spoodles29-Nov-04 4:05
memberSpoodles29-Nov-04 4: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.

| Advertise | Privacy | Terms of Use | Mobile
Web02 | 2.8.160426.1 | Last Updated 3 Oct 2004
Article Copyright 2004 by chakkaradeepcc
Everything else Copyright © CodeProject, 1999-2016
Layout: fixed | fluid