private void InitSoundPlayer() { if (_soundPlayer != null) { _soundPlayer.Dispose(); } switch (_config.Player.Format) { case SoundPlayerType.Wav: _soundPlayer = new WavPlayer(Logger, _config.Player.DeviceLatency); break; case SoundPlayerType.Spx: _soundPlayer = new SpeexPlayer(Logger, _config.Player.DeviceLatency); break; case SoundPlayerType.SpxCmd: _soundPlayer = new CommandSpeexPlayer(Logger); break; case SoundPlayerType.Silent: _soundPlayer = new SilentPlayer(); break; default: throw new Exception("Неизвестный формат плеера"); } _soundPlayer.PlayingStopped += SoundPlayer_PlayingStopped; }
public void Dispose() { StopQueue(); _player?.Dispose(); DispouseSoundMessageChangeRx.Dispose(); }
internal void Release() { m_Player?.Dispose(); }