Text to Speech
In .NET it is very easy to convert a given text into a Speech which can be heard from the speaker (provided it is connected to the machine). The process is very simple and is defined in the following steps (NOTE: the following code has been written for Windows Form):-
- Now on the Click Event of the button Text to Speech add the following code (SpeechSynthesizer Class is defined within the namespace using System.Speech.Synthesis)
SpeechSynthesizer synths = new SpeechSynthesizer(); synths.SpeakAsync(txtSpeech.Text);
- Finally, run the application and the text that you will type in the textbox can be heard from an attached speaker once the button Text to Speech is clicked.
SpeechSynthesizer provides access to the functionality of an installed a speech synthesis engine. More info can be found here