How to make Text to speech application in c# windows form Application

How to make Text to speech application in c# windows form Application


NOTE:
 Download and install Visual studio 2010 (or newer version), if you already have Visual studio then open new project and go to visual c# and select windows form application and name it as text-to-speech application and then press enter.

Now, Following screen will pop up:

1) Now right click on the form and select Properties from the drop down list and then at the right side a property menu will appear from there search Text and change it from form1 to Text to Speech, then re-size the form from its arch as you want it to be look alike.

2) Then at the top menu bar there's a view menu click on it and a drop down list occurs select toolbox from it. Basically a tool box is used to Put the things you're going to use in your Form simply called as GUI(Graphical user Interface).

3)After clicking on the tool box a menu pops up from there find out the text box and drag it into the form. and resize it and then right click on the text box and and go to properties and find multiline in properties menu and make it true.

4)Now go to toolbox again and select a button from it and drag it into the left bottom corner and then right click on it and select properties then go to properties and find the text property and change the text to &Speak (&: it is used to underline the first word of the text).

5)Now goto tool box and find out the track bar and drag it to the bottom right corner of the form and then right click on it select properties and goto Name properties and change its name to SoundTrackBar.

6) Now go to tool box and find out the Label and drag it to the left of Trackbar and then right click on it and goto properties and find out the Text property and change its text to Volume: and then find out the maximum and minimum property at minimum property write 0 and at maximum property write 100 and then find out the value property and change it from 0 to 75 (Value means that whenever we run our app the volume will be set to 75 everytime.)

7)Now double left click on the button and it'll open a coding part. before writing any code we've add a reference so for doing this go to view and select solution explorer and there is an reference folder right click on it go to .NET option and Find  System.Speech and then select Ok .

8)Now add two libraries in the coding part:
a)using System.Speech.Synthesis;
b)using System.Speech.Recognition;

Now go to form and double click on button which will generate a method, now see the picture and write the following lines written in it:



Now Run the application after saving it with Ctrl + S .
To run the application go to the top and there's a great right triangle click on it and it'll open the following: 



Write any line in the text box to listen it in voice also use track bar to up and down the volume!

Comments

Contact Form

Name

Email *

Message *