Welcome to WindowsClient.net | Sign in | Join

How Do I: Use Windows 7 Text-to-Speech from .NET 4 and WPF

In this session, Pete Brown shows us how to use Windows 7 text-to-speech facilities in .NET 4 to make your .NET applications talk. No need to drop down to the SAPI APIs when you can do it all from within managed code. Thrown in for good measure is a simple implementation of the ViewModel pattern in WPF 4.

Note that will generally apply to .NET 3+ and Windows XP and Vista, although XP will have different voices and configuration dialogs. Projects and solutions are in VS2010.

Author: Pete Brown

Related Blog Post

 

Duration: 20:36

Video Downloads:
WMV | WMV (Zip) | Zune | iPod | PSP | MPEG-4 | 3GP

Audio Downloads:
AAC | WMA | MPEG-4 | MPEG-3 | MPEG-2

Sample Code:
VB | C#

You must Login to comment.Comments: 3

a.pierini: On January 11, 2010 6:00 AM said:

Great stuff indeed!

But what about using that in Silverlight 4? Could it be possible with some modifications?

Viva C64! :)

 

a.pierini: On January 11, 2010 8:09 AM said:

noooo War games!!! I saw it just yesterday!!! (I'm from Italy 35 years old)...

Because of that film I started using computers!!! What a mistake!! :P

 

Pete Brown: On April 18, 2010 11:45 AM said:

Yes, you can do this in Silverlight 4 using the IDispatch/COM API. It's not exactly the same API as the .NET wrapper over SAPI, but it's definitely close. Here's an example from my Silverlight in Action (revised edition) Book:

if (AutomationFactory.IsAvailable)

{

   using (dynamic voice = AutomationFactory.CreateObject("Sapi.SpVoice"))

   {

       voice.Speak("I'm better than any in-page midi file!");

   }

}

 



Featured Item