A simple way to generate synthesized speech is to create a SpeechSynthesizer instance, and then call the synthesizer’s Speak(String) method, passing the string to be spoken as an argument.
The following example shows the Main method of a class in a console application. When Main begins to run, the example creates a SpeechSynthesizer instance named synth. Then the example calls the Speak(String) method on synth, and passes in a string literal to be spoken.
staticvoid Main(string args)
SpeechSynthesizer synth = new SpeechSynthesizer();
synth.Speak("This example speaks the text in a string.");
Was this page helpful?
Your feedback about this content is important. Let us know what you think.
1500 characters remaining
We appreciate your feedback.
Have a suggestion to improve MSDN Library?
Visit our UserVoice Page to submit and vote on ideas!