Friday, January 6, 2017

Text to speech using C#.net


.Net is provided text to speech functionality, which contains all the functionalities like it can speech the provided text, pause, continue, record the speech, etc… .
To achieve it, below information required to refer the dll and use the namespace:
Dll:System.Speech
Namespace:using System.Speech.Synthesis;

Class and methods for Speech functionalities:
Initialize the main class:
SpeechSynthesizer synthesizerObject = new SpeechSynthesizer();
Speech Method:
synthesizerObject.SpeakAsync(“Good morning Kishan!”);













Select Voice & age of the voice speaker:
synthesizerObject.SelectVoiceByHints(VoiceGender.Female, VoiceAge.Adult);

Volume & Speed of the speech:
synthesizerObject.Rate = 20; // Speed
synthesizerObject.Volume = 80; // Volume
Recording the speach:
synthesizerObject.SetOutputToDefaultAudioDevice()