Esempio n. 1
0
 void Speak(TTSText text)
 {
     if (!string.IsNullOrEmpty(text.Voice))
     {
         synthesizer.SelectVoice(text.Voice);
     }
     synthesizer.SpeakAsync(text.Text);
     TextSpoken?.Invoke(text.Voice, text.Text);
 }
Esempio n. 2
0
 void fireTextSpokenEvent(string text)
 {
     try
     {
         Task t = new Task(() =>
         {
             if (TextSpoken != null)
             {
                 try { TextSpoken.Invoke(this, new AudioRendererTextEventArgs(text)); }
                 catch (Exception)
                 { }
             }
         });
         t.Start();
     }
     catch (Exception)
     { }
 }