PPWe will create a WPF application and useSpeechSynthesizer 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
Use Speak method for TextToSpeech.
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.