Esempio n. 1
0
 internal override void InjectEvent(TTSEvent ttsEvent)
 {
     if (!_aborted && _asyncDispatch != null)
     {
         _asyncDispatch.Post(ttsEvent);
     }
 }
Esempio n. 2
0
 internal override void InjectEvent(TTSEvent ttsEvent)
 {
     if (_asyncDispatch != null && !_aborted)
     {
         lock (_queueIn)
         {
             if (_queueIn.Count == 0)
             {
                 _asyncDispatch.Post(ttsEvent);
             }
             else
             {
                 _queueIn.Add(new InItem(ttsEvent));
             }
         }
     }
 }
Esempio n. 3
0
 internal void SendNotification(object ignored)
 {
     lock (this)
     {
         if (_sapiEventSourceReference != null)
         {
             ISpEventSource spEventSource = (ISpEventSource)_sapiEventSourceReference.Target;
             if (spEventSource != null)
             {
                 List <SpeechEvent> list = new List <SpeechEvent>();
                 SpeechEvent        item;
                 while ((item = SpeechEvent.TryCreateSpeechEvent(spEventSource, _additionalSapiFeatures, _audioFormat)) != null)
                 {
                     list.Add(item);
                 }
                 _dispatcher.Post(list.ToArray());
             }
         }
     }
 }