This time, I will teach you how to create a Text to Speech Application in C#. In this method you will be able to make the machine speak because of .Net Framework that produces the speech libraries. Simply follow the steps below to see how it works.
Open Microsoft Visual Studio 2015 and create a new windows form application in C#.
Do the form just like shown below.
Go to solution explorer, right click the “References” and hit add reference.
System.Speech and hit “ok”.
Add a namespace below to access Speech library.
- using System.Speech.Synthesis;
Double click the “Speak” button and do the following codes to make the machine speak when the button is clicked.
- private void button1_Click(object sender, EventArgs e)
- SpeechSynthesizer speaks = new SpeechSynthesizer();
- string msg;
- msg = "Welcome to sourcecodester.com";
- speaks.Rate = 1;
- speaks.Volume = 100;
For more question about this article. You can contact me @
Email – [email protected]
Mobile No. – 09305235027 – TNT
FB Account – https://www.facebook.com/onnaj.soicalap
Or feel free to comment below.
Note: Due to the size or complexity of this submission, the author has submitted it as a .zip file to shorten your download time. After downloading it, you will need a program like Winzip to decompress it.
Virus note: All files are scanned once-a-day by SourceCodester.com for viruses, but new viruses come out every day, so no prevention program can catch 100% of them.
FOR YOUR OWN SAFETY, PLEASE:
1. Re-scan downloaded files using your personal virus checker before using it.
2. NEVER, EVER run compiled files (.exe's, .ocx's, .dll's etc.)--only run source code.