User Tools

Site Tools


snippets:text_to_speech

Assembly (reference)

System.Speech

Using directive

using System.Speech.Synthesis;

Code: say "hello world"

SpeechSynthesizer speaker = new SpeechSynthesizer();
speaker.Rate = 1;
speaker.Volume = 100;
speaker.SelectVoiceByHints(VoiceGender.Female, VoiceAge.Adult);
speaker.SpeakAsync("Hello World");

Code: list available voices

SpeechSynthesizer speaker = new SpeechSynthesizer();
speaker.GetInstalledVoices()
snippets/text_to_speech.txt · Last modified: 2015/07/26 10:11 by jaap.dehaan