예제 #1
0
 private void Dispose(bool disposing)
 {
     if (!_isDisposed && disposing && _voiceSynthesis != null)
     {
         _isDisposed = true;
         SpeakAsyncCancelAll();
         if (_outputStream != null)
         {
             if (_closeStreamOnExit)
             {
                 _outputStream.Close();
             }
             else
             {
                 _outputStream.Flush();
             }
             _outputStream = null;
         }
     }
     if (_voiceSynthesis != null)
     {
         _voiceSynthesis.Dispose();
         _voiceSynthesis = null;
     }
     _isDisposed = true;
 }
예제 #2
0
 void OnDestroy()
 {
     if (theVoice == this)
     {
         Debug.Log("Destroying speech");
         destroySpeech();
         theVoice = null;
     }
 }
예제 #3
0
 // Use this for initialization
 void Start()
 {
     if (theVoice == null)
     {
         theVoice = this;
         DontDestroyOnLoad(gameObject);
         initSpeech();
     }
     //else
     //Destroy(gameObject);
 }
예제 #4
0
 /// <param name="voiceSynthesis">Voice synthesizer used</param>
 /// <param name="ttsVoice">Default engine to use</param>
 internal SpeakInfo(VoiceSynthesis voiceSynthesis, TTSVoice ttsVoice)
 {
     _voiceSynthesis = voiceSynthesis;
     _ttsVoice       = ttsVoice;
 }
예제 #5
0
 internal InstalledVoice(VoiceSynthesis voiceSynthesizer, VoiceInfo voice)
 {
     _voiceSynthesizer = voiceSynthesizer;
     _voice            = voice;
     _enabled          = true;
 }