I am looking for a way to convert text(string) in ENG to speech(sound) in c#. do anyone know for a way or some open-source lib that can help me with this task?
You can do this with the help of System.Speech.Synthesis namespace. For that, you need to add a reference to System.speech.dll first.
Try this:
using System.Speech.Synthesis;
namespace TextToSpeech
{
public partial class Form1 : Form
{
SpeechSynthesizer speak;
public Form1()
{
InitializeComponent();
speak = new SpeechSynthesizer();
}
private void button1_Click(object sender, EventArgs e)
{
string text="Speak this";
speak.SpeakAsync(text);
}
}
}