PPWe will create a WPF application and use SpeechSynthesizer class and methods to enter text in Textbox and then convert into speech.
Step 1: Create New Project and go to '

Create New Project, Select File, New, then Project'.
Select Windows and Create WPF application as per the following screen,

Step 2: From the toolbox add 1 Textbox, 1 button and 2 Radiobuttons and design your layout as in the following,

Step 3: Right click on Project and add reference 'System.speech'
Step 4: Add the Namespace: System.Speech.Synthesis in your .cs file and add code on button click event as per the following screen,
Use SelectVoiceByHints Method and pass VoiceGender.Male or for VoiceGender.Female.
Use Speak method for TextToSpeech.
code : button_Click
- private void button_Click(object sender, RoutedEventArgs e)
- {
- SpeechSynthesizer ss = new SpeechSynthesizer();
- if (radioButtonMale.IsChecked == true)
- {
- ss.SelectVoiceByHints(VoiceGender.Male);
- ss.Speak(textBox.Text);
- }
- else
- {
- ss.SelectVoiceByHints(VoiceGender.Female);
- ss.Speak(textBox.Text);
- }
- }
Step 5: Now run the application and enter some text in textbox and check on 'Male Voice' and hit 'Click Here' Button. Also check for 'Female Voice' option.

For more details download the attached code.
Hope you liked this article.

Santhakumar MunuswamyPosted Dec 26, 2015, 2:09 AM
Thanks for sharing
Ankur MistryPosted Dec 5, 2015, 7:22 AM
Thanks
Vinodh NarayananPosted Dec 5, 2015, 5:05 AM
Good one
Mayank SharmaPosted Dec 3, 2015, 8:52 AM
Atleast we get information how to start from basics. Good work Sir.
Ankur MistryPosted Dec 2, 2015, 11:55 PM
Thanks for the guidance Sir, i will explain in more detail.
Mahesh ChandPosted Dec 2, 2015, 8:23 PM
Good points Afzaal. Community is all about teaching, learning, and improving everyday.
Afzaal Ahmad ZeeshanPosted Dec 2, 2015, 12:31 PM
Don't take me wrong, but "basic" is not an article. If you just want to share the code snippet, post it in code section. You can also post it as a blog. Article must have enough content in it.
Ankur MistryPosted Dec 2, 2015, 12:16 PM
Thanks Afzaal, this is a basic steps, i read your article its in detail and thanks for sharing
Afzaal Ahmad ZeeshanPosted Dec 2, 2015, 12:05 PM
Good start Ankur, but you missed many "important" points here. You forgot to mention the "VoiceInfo", how to get InstalledVoices and many more. Can I ask you to update the article to include some more details? You can read my article to learn more about this, http://www.c-sharpcorner.com/UploadFile/201fc1/an-app-that-reads-out-text-for-you/ I hope you will find many more concepts worth discussing.
Abhishek BhatPosted Dec 2, 2015, 7:00 AM
Please update the title..it says TextToSpeech using WCF.
supriya tarsePosted Dec 2, 2015, 5:24 AM
Nice
Bhalchandra mithbavkarPosted Dec 2, 2015, 5:01 AM
Thank you for information