Ejemplo n.º 1
0
        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;
        }
Ejemplo n.º 2
0
 public void Dispose()
 {
     StopQueue();
     _player?.Dispose();
     DispouseSoundMessageChangeRx.Dispose();
 }
Ejemplo n.º 3
0
 internal void Release()
 {
     m_Player?.Dispose();
 }