public void StopEncoding()
        {
            lock (lockObj)
            {
                _textToSpeech?.Dispose();
                _textToSpeech = null;

                _wasapiCapture?.StopRecording();
                _wasapiCapture?.Dispose();
                _wasapiCapture = null;

                _resampler?.Dispose(true);
                _resampler = null;

                _waveOut?.Stop();
                _waveOut?.Dispose();
                _waveOut = null;

                _micWaveOut?.Stop();
                _micWaveOut?.Dispose();
                _micWaveOut = null;

                _volumeSampleProvider = null;
                _clientAudioMixer?.RemoveAllMixerInputs();
                _clientAudioMixer = null;

                _clientsBufferedAudio.Clear();

                _encoder?.Dispose();
                _encoder = null;

                if (_udpVoiceHandler != null)
                {
                    _udpVoiceHandler.RequestStop();
                    _udpVoiceHandler = null;
                }

                _speex?.Dispose();
                _speex = null;

                SpeakerMax = -100;
                MicMax     = -100;

                _effectsOutputBuffer = null;

                foreach (var guid in _subs)
                {
                    MessageHub.Instance.UnSubscribe(guid);
                }
                _subs.Clear();
            }
        }
 private void InitTextToSpeech()
 {
     _textToSpeech = new TextToSpeechManger(_clientAudioMixer);
 }