Click here to Skip to main content
11,505,486 members (57,517 online)
Click here to Skip to main content

Tagged as

My PC Can Speak and Understand 26 Languages. And Yours?

, 5 Jun 2011 CPOL 31.3K 7.9K 79
Rate this:
Please Sign up or sign in to vote.
TTS and SR with Microsoft Server Speech Platform 10.2 for 26 languages


If you are interested in computer text to speech (TTS) and speech recognition (SR), this little article is for you. In order to make the PC capable of speech and speech recognition, we need to install the Microsoft Server Speech Platform 10.2, its SDK and the Runtime Languages for TTS and SR you wish. Here are the links:

NOTE: The Microsoft .NET Framework 3.5 is required to run the Microsoft Speech Platform. Starting from version 10.2 of the latter, the minimum OS required is Windows Vista. If you still have Windows XP, you can try to download an older version, may be 10.1.

After that, we need to create a Windows Form application and add the following reference to the project:

Assembly Microsoft.Speech
C:\Program Files\Microsoft Speech Platform SDK\Assembly\Microsoft.Speech.dll

Using the Code

Here is the code to enumerate the installed TTS voices:

// Create the TTS object and setup to fire the event 'SpeakCompleted'
SpeechSynthesizer _tts = new SpeechSynthesizer();

// Enumerate the installed Microsoft Server Speech TTS Voices
foreach (InstalledVoice voice in _tts.GetInstalledVoices())

Here is the code to speech text:

SoundPlayer _player = new SoundPlayer();

public void Speak(string text)
    _player.Stream = new System.IO.MemoryStream();

Here is the code to setup the speech recognition engine:

SpeechRecognitionEngine _sre = null;

// Create a simple grammar that recognizes the words
Choices words = new Choices();

// Add the words to be recognised

GrammarBuilder gb = new GrammarBuilder();
gb.Culture = new System.Globalization.CultureInfo(strCulture);

// Create the actual Grammar instance, and then load it into the speech recognizer.
Grammar g = new Grammar(gb);

// Register a handler for the SpeechRecognized event.
_sre.SpeechRecognized += 
	new EventHandler<SpeechRecognizedEventArgs>(sre_SpeechRecognized);

// Simple handler for the SpeechRecognized event.
void sre_SpeechRecognized(object sender, SpeechRecognizedEventArgs e)
    // Add to the listbox the recognised speech


Computer speech and speech recognition are interesting subjects. Nowadays, we can start interacting with the PC using voice. I remember the telefilms Start Trek and Knight Rider. There they could talk with the computer using the voice. These days, they are getting closer, but they are still far away. By the way, if the computer voice doesn't work well, ask Mr. Spock to fix it Smile | :)  


This article, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)


About the Author

Massimo Conti
Software Developer
Italy Italy
No Biography provided

Comments and Discussions

QuestionI need help Pin
gKreator40426-Nov-12 19:14
membergKreator40426-Nov-12 19:14 
AnswerRe: I need help Pin
Massimo Conti2-Dec-12 2:51
memberMassimo Conti2-Dec-12 2:51 
You need to install the following for your Windows Platform (x86 or x64)

Microsoft Speech Platform - Server Runtime (Version 10.2)
Microsoft Speech Platform - Software Development Kit (SDK) (Version 10.2)

For the Languages: Microsoft Speech Platform - Server Runtime Languages (Version 10.2)

NOTE: You need to install 2 packages for each Language, one for Speech Recognition (SR) and one for Text To Speech (TTS). For example, the following for English SR & TTS.


If you miss the TTS, you could get the error you are reporting.

Now there is out the version 11 of the Microsoft Speech Platform.
Remember that if you choose to use that version, and not the 10.2, you need to download all of that version.

I hope this helps.

QuestionCom Exception Error Pin
brother.gabriel5-Jul-12 5:20
memberbrother.gabriel5-Jul-12 5:20 
AnswerRe: Com Exception Error Pin
Massimo Conti5-Jul-12 11:28
memberMassimo Conti5-Jul-12 11:28 
GeneralMy vote of 5 Pin
Sergio Andrés Gutiérrez Rojas17-Jan-12 15:19
memberSergio Andrés Gutiérrez Rojas17-Jan-12 15:19 
GeneralGreat article! Pin
EricSmekens18-Oct-11 1:05
memberEricSmekens18-Oct-11 1:05 
GeneralRe: Great article! Pin
Massimo Conti18-Oct-11 8:18
memberMassimo Conti18-Oct-11 8:18 
GeneralMy vote of 4 Pin
Yvan Rodrigues7-Jun-11 4:06
memberYvan Rodrigues7-Jun-11 4:06 
GeneralRe: My vote of 4 [modified] Pin
Massimo Conti7-Jun-11 10:25
memberMassimo Conti7-Jun-11 10:25 
QuestionWhat about Mono? Pin
Riz Thon6-Jun-11 16:54
memberRiz Thon6-Jun-11 16:54 
AnswerRe: What about Mono? Pin
Massimo Conti7-Jun-11 10:14
memberMassimo Conti7-Jun-11 10:14 
AnswerRe: What about Mono? Pin
Massimo Conti7-Jun-11 11:59
memberMassimo Conti7-Jun-11 11:59 

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.

| Advertise | Privacy | Terms of Use | Mobile
Web03 | 2.8.150520.1 | Last Updated 5 Jun 2011
Article Copyright 2011 by Massimo Conti
Everything else Copyright © CodeProject, 1999-2015
Layout: fixed | fluid