Home

SpeakComputers.com | Text-to-Speech Software

Natural sounding TTS voice support | Cepstral TTS voices | Text to MP3 | Natural Readers

Text to Speech Software Text to Speech Voices SpeakComputer Text to Speech Software

Text to Speech, System.Speech.

The Microsoft .Net Framewok version 3.0 introduces the long awaited System.Speech assembly. With the System.Speech assembly you can create speech enabled Windows applications including, Text to Speech and Speech recognition.

Namespace: System.Speech
Assembly: Systems.Speech.dll

using System.Speech;
Calling: System.Speech
Requirements: .Net FrameWork 3.0

Download the complete project here. Requirements, VisualStudio 2005 and .Net 3.0

Creating Speech enabled Windows applications could not be easier. To prove to you just how easy it is, lets create a simple yet powerful Text to Speech application. We are going to create a Single document interface, add a menu, context menu, status bar and use a richtextbox control for our textarea.

To start, open Visual Studio 2005, create a new Windows c# project. Add a reference to the System.Speech assembly. On Form1 or mainForm add a statusBar, context menu, MenuStrip and a richTextBox which will be docked to fill the form.

Declare your SpeechSynthesizer speakRBox.
System.Speech.Synthesis.SpeechSynthesizer speakRBox = new System.Speech.Synthesis.SpeechSynthesizer();

On the MenuStrip, create Speak, Pause and Stop menu items. Create the Click events for the menu items just created. Under the Speak event add the following code.

if (speakRBox.State == System.Speech.Synthesis.SynthesizerState.Ready) { speakRBox.SpeakProgress += new EventHandler(speakRBox_SpeakProgress); speakRBox.SpeakCompleted += new EventHandler(speakRBox_SpeakCompleted); speakRBox.SelectVoice(toolStripComboBox1.SelectedItem.ToString()); speakRBox.SpeakAsync(this.richTextBox1.Text); return; } if (speakRBox.State == System.Speech.Synthesis.SynthesizerState.Paused) { speakRBox.Resume(); }

Under the Pause event, add the following code.

if (speakRBox.State == System.Speech.Synthesis.SynthesizerState.Speaking) { speakRBox.Pause(); this.toolStripStatusLabel1.Text = "Paused"; return; } if (speakRBox.State == System.Speech.Synthesis.SynthesizerState.Paused) { speakRBox.Resume(); } 

Under the Stop event.

if (speakRBox.State == System.Speech.Synthesis.SynthesizerState.Speaking) { speakRBox.SpeakAsyncCancelAll(); } 

Additional things to do.

You can add the feature of speaking the text to a wav file for later play back. To do this, add a menu item and create a click event. Under the click event add the following code.

speakRBox.SetOutputToWaveFile(@"c:\1.wav");
speakRBox.SpeakAsync("Hello World");
Top of page
Text to Speech Speech synthesis Software TTS Software
Copy Right 2006 SpeakComputers.com - All Rights Reserved.
About Privacy Policy TTS Resouces
Free Text to Speech software
Free Text to Speech Software