Frank La Vigne

Fear and Loathing in .NET

Subscription Options

Blog
Add to Google

Subscribe in Bloglines
Subscribe in NewsGator Online
Add Frank La Vigne to Newsburst from CNET News.com

Subscribe in Rojo
Podcast
Subscribe in podnova
Add Frank La Vigne to ODEO

My Links

News






Post Categories

Archives

Image Galleries

Blog Stats

Blog Roll

Favorite Sites

Gadget Blogs

Tablet PC Links

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: , , ,

posted on Friday, May 25, 2007 10:27 AM