public void Play() { var synth = new SpeechLib.SpVoiceClass(); var voices = synth.GetVoices("", $"Gender={VoiceGender};Age={VoiceAge};Language={new CultureInfo(CultureInfo).LCID:X}"); synth.Voice = voices.Item(0); synth.Volume = Volume; synth.Rate = Rate; synth.Speak(Text); }
public SpeechHandler() { /*if (File.Exists(Environment.GetEnvironmentVariable("SystemRoot")+@"\Speech\Xvoice.dll")) { * SAPI4Supported = true; * } else { * SAPI4Supported = false; * }*/ voice = new SpeechLib.SpVoiceClass(); tokens = voice.GetVoices("", ""); sd = new SpeakDelegate(voice.Speak); }