Beispiel #1
0
        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);
        }
Beispiel #2
0
 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);
 }