Create a new Windows application, design the form as follows:When entering text into the textbox and the speak button is clicked then this program will read out the text in the textbox.Solution:After designing the form, the button click event must be raised. Use the following code for it.Speak:string text = textBox1.Text;SpeechController.Instance.Speech(text);Create a new class with the name SpeechController and add the following namespaces:using System.Speech.Synthesis;using System.Speech.AudioFormat;And use the following code for it:public static SpeechController Instance{ get {return msInstace; }}
private static SpeechController msInstace=new SpeechController();private SpeechSynthesizer mySys = new SpeechSynthesizer();
public void Speech(string text){ mySys.SpeakAsync(text);}
You need to be a premium member to use this feature. To access it, you'll have to upgrade your membership.
Become a sharper developer and jumpstart your career.
$0
$
. 00
monthly
For Basic members:
$20
For Premium members:
$45
For Elite members: