If only this app could speak…
- Posted: Jan 28, 2011 at 6:00AM
- 8,429 views
- 4 comments
Loading user information from Channel 9
Something went wrong getting user information from Channel 9
Loading user information from MSDN
Something went wrong getting user information from MSDN
Loading Visual Studio Achievements
Something went wrong getting the Visual Studio Achievements
How’s that to start off my second post to the Coding4Fun blog? A folksy, friendly greeting to try to set the tone for this and future posts. Where, a couple times a week, I’ll be posting about cool coding, development and tech stuff I find around the Net. Stuff that the people who just love to code might also find interesting. Now, on to the show…
There’s something compelling about computers and the spoken word. It just seems normal to expect that we should be able to have a conversation with our computers. For me it began with 2001, A Space Odyssey and the HAL9000 (or was it Star Trek and the Enterprise’s computer?) Since then, every time I see voice control or voice output from a computer or application I find myself drawn to it.
In this article we are going to explore the Speech API library that’s part of the TTS SDK that helps you reading text and speaking it. We’re going to see how to do it programmatically using C# and VB.NET and how to make use of LINQ to make it more interesting. The last part of this article talks about…… won’t tell you more, let’s see!
The Speech API library that we are going to use today is represented by the file sapi.dll which’s located in %windir%\System32\Speech\Common. This library is not part of the .NET BCL and it’s not even a .NET library, so we’ll use Interoperability to communicate with it (don’t worry, using Visual Studio it’s just a matter of adding a reference to the application.)
This article shows how simple it really is to have your C# or VB application talking to your users. In just a couple lines of code, you can quickly add voice output. We’re not talking pre-recorded sound bites or dialogue but real Text To Speech (TTS). Then the sky is the limit. You can add tweaks to improve the pronunciation, change voices and more. Oh have I said that if you have Windows Vista/7 that this capability is just waiting for you to use it already, free?
Here’s a few more links you might find interesting:
Post thumbnail cutesy of Robert Simmons