Hello Friends ... .!!
This is The First Project I'm Posting About C# WPF ( Windows Presentation Foundation ).
This is The First Project I'm Posting About C# WPF ( Windows Presentation Foundation ).
It is just a simple Project That Takes The Text You Write In A Text Box And Spell It by A Male Or Female Voice .. However You Want ..
At The End Of the Post You Will Find A Download Link For The Working Project With It's Source Code Uploaded To Media Fire .
Before You Run To Download The Project and Try it out I need you To Know How I Did It , So When You Are Planning To Implement The Code Yourself , You Wont Feel That I Did Something Magical Or Such .. :)
Steps To Create A TextToSpeech Application :
- Open Visual Studio and Create A New Project From C# List Select WPF Windows Application.
- Design The Form by Adding Two Radio Buttons , TextBox and A Button.
- From The Project List Click On Add Reference
- Find From The List System.Speech
- Now Add The Namespace using System.Speech.Synthesis; Create instance of Synthesis , Synthesis Sound = new Synthesis();
- Add This Code To The btnSpeak_Click Event
try
{
if (RadioMale.IsChecked == true)
{
voice.SelectVoiceByHints(VoiceGender.Male);
}
else
{ voice.SelectVoiceByHints(VoiceGender.Female); }
voice.SpeakAsync(txtToSpeech.Text);
}
catch (Exception ex)
{
MessageBox.Show(ex.Message);
}
ConversionConversion EmoticonEmoticon