Bookmark and Share Share...    Subscribe to this feed Feed   About me...


How to use the Speech Synthesizer in WPF

Microsoft provides a new speech API (SAPI) for Windows Vista and later. It allows developers to build speech enabled applications. Simply add a reference to System.Speech and include the following code to your project.

 
using System.Speech.Synthesis;
 
SpeechSynthesizer synthesizer = new SpeechSynthesizer(); 
synthesizer.Volume = 50;  // 0...100
synthesizer.Rate = 3;     // -10...10
 
// Synchronous
synthesizer.Speak("Welcome to the WPF Tutorial.");
 
// Asynchronous
synthesizer.SpeakAsync("Welcome to the WPF Tutorial.");
 
 



 Comments on this article

Show all comments
Thomas
Commented on 2.February 2010
It works on Windows XP as well though.
Prakash
Commented on 31.March 2010
What is Rate.... why it is used? and wats the difference between speak and speakasync
Nouf
Commented on 5.May 2010
Speak is used for one after one speech , but speakasync will do asyncronously , means if u write speakasync method twice two speech will done simultaniusly
Parimal Pimple
Commented on 27.June 2010
Rate shoud be the tempo of speech.
Parimal Pimple
Commented on 27.June 2010
yesit it is the tempo of speech. -10 being the slowest, 10 being the fastest.
Om
Commented on 1.July 2010
Nice Post........
Miro
Commented on 15.July 2010
Nouf, this is only a partial explanation of speakasync. This method means that once the line of code is executed speach will start and the execution of the code continues. That means the application is still able to respond.
Miro
Commented on 15.July 2010
Nouf, this is only a partial explanation of speakasync. This method means that once the line of code is executed speach will start and the execution of the code continues. That means the application is still able to respond.
Christian Moser
Commented on 23.August 2010
Its funny that you guys find my articles so helpful considering I just copy and pasted random shit from other random sites that I found. Its all good though because those google ads are making me cash!!!
Christian...
Commented on 23.August 2010
Its funny that you guys find my articles so helpful considering I just copy and pasted random shit from other random sites that I found. Its all good though because those google ads are making me cash!!!
Christian M
Commented on 23.August 2010
I apprieciate your feedback but I cant explain it anymore in depth because I just copy and pasted this from another website

Name
E-Mail (optional)
Comment
About Christian Moser