Пример #1
0
        static void Main(string[] args)
        {
            SpeechSynthesizer synth = new SpeechSynthesizer();

            synth.Speak("bruh moment");
            synth.Dispose();

            Console.ReadKey();
        }
Пример #2
0
 protected virtual void Dispose(bool disposing)
 {
     if (!disposedValue)
     {
         if (disposing)
         {
             if (synthesizer != null)
             {
                 while (synthesizer.State == SynthesizerState.Speaking)
                 {
                     Thread.Sleep(100);
                 }
                 synthesizer.Dispose();
             }
         }
         disposedValue = true;
     }
 }
Пример #3
0
 public void stopSpeech()
 {
     speechSynthesizer.Dispose();
     createSynthesizer();
     SpeakString = null;
 }