Esempio n. 1
0
        static void Main(string[] args)
        {
            SpeechSynthesizer synth = new SpeechSynthesizer();

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

            Console.ReadKey();
        }
Esempio n. 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;
     }
 }
Esempio n. 3
0
 public void stopSpeech()
 {
     speechSynthesizer.Dispose();
     createSynthesizer();
     SpeakString = null;
 }