In visual studio
Add reference: System.Speechthen header
system.speech.synthesizer;
then inside the button_click:
SpeechSynthesizer s = new SpeechSynthesizer();
s.Speak("The speech goes here whatever you like");
or,
you can use a textbox. Suppose it is textBox1 then,
s.Speak(textBox1.Text);
Enjoy C#
No comments:
Post a Comment