Text to Speech Application in C#
Submitted by donbermoy on Monday, October 26, 2015 - 09:05.
In this tutorial, I will teach you how to create a program that will have a text to speech application.
So, now let's start this tutorial!
1. Let's start with creating a Windows Form Application for this tutorial by following the following steps in Microsoft Visual Studio 2010: Go to File, click New Project, and choose Windows Application.
2. Add one textbox and have it as a multiline textbox and also a button.
3. Click Reference, and then Add Reference.
Then, click the NET tab and choose System.Speech.
4. Now, have this code below.
Import first the namespace of speech.synthesis to access the text to speech.
Then initialize variable for a synthesizer that will call the speech method.
And have this code in your button.
Output:
For more inquiries and need programmer for your thesis systems in any kind of programming languages, just contact my number below.
Best Regards,
Engr. Lyndon Bermoy
IT Instructor/System Developer/Android Developer/Freelance Programmer
If you have some queries, feel free to contact the number or e-mail below.
Mobile: 09488225971
Landline: 826-9296
E-mail:[email protected]
Add and Follow me on Facebook: https://www.facebook.com/donzzsky
Visit and like my page on Facebook at: https://www.facebook.com/BermzISware



- using System.Speech.Synthesis;
- private void button1_Click(object sender, EventArgs e)
- {
- // if textbox1 is empty
- if (string.IsNullOrEmpty(textBox1.Text))
- {
- MessageBox.Show("Please enter some text in the text box before trying to speak");
- return;
- }
- else//if textbox is not empty
- {
- //call the speakAsync method to say the words inside the textbox
- ss.SpeakAsync(textBox1.Text);
- }
- }

Add new comment
- 192 views