Online Since 1995

About Frank

Speech Synthesis in WPF

Adding Speech Synthesis to your WPF applications is amazingly easy.

To add speech to any WPF application, you'll need to add a reference in your project to System.Speech.

In your code, add the following using statement:

using System.Speech.Synthesis;

To actually say something, add something like this:

SpeechSynthesizer synthesizer = new SpeechSynthesizer();

synthesizer.SpeakAsync("Welcome to Speech Synthesis.");

There's a lot more to the Speech API than that, but that's enough to get your applications talking to you.  ;)

You can also insert pauses, change the voice, spell out words, and even persist your "script" as SSML, an XML markup language endorsed by the W3C.

I put together a quick demo application to show off some basic concepts.

[Download Demo App]

 

Technorati tags: , , ,
Add a Comment