Adding an option for converting text to speech in an application can come in handy in a variety of different situations. So today, i will show you how to build text to speech application in c#.net step by step.
4. Then click ok.
5. After that design a form listed below:
6. Click on Project-->Add Reference--->Then select System.Speech and click OK.
7. Then double click on Speak button and write code listed below:
//Add one Namespace
using System.Speech.Synthesis;
private void button1_Click(object sender, EventArgs e)
{
SpeechSynthesizer ss = new SpeechSynthesizer();
ss.Speak(textBox1.Text);
}
8. Press F5 to execute this application.
- Open Visual C# 2010 Express
- Then click on File-->New Project
- A dialog box will open, then choose windows forms application.
4. Then click ok.
5. After that design a form listed below:
6. Click on Project-->Add Reference--->Then select System.Speech and click OK.
7. Then double click on Speak button and write code listed below:
//Add one Namespace
using System.Speech.Synthesis;
private void button1_Click(object sender, EventArgs e)
{
SpeechSynthesizer ss = new SpeechSynthesizer();
ss.Speak(textBox1.Text);
}
8. Press F5 to execute this application.