public static void Dispose()
        {
            if (mp3Channel != null)
            {
                mp3Channel.Dispose();
            }
            DisposeVST();

            if (UsedLibrary == AudioLibrary.NAudio)
            {
                //NAUDIO
                Samples.Clear();
                if (playbackDevice != null)
                {
                    playbackDevice.Stop();
                    playbackDevice.Dispose();
                    playbackDevice = null;
                }

                if (Mixer32 != null)
                {
                    Mixer32.Dispose(); Mixer32 = null;
                }
            }
            UsedLibrary = AudioLibrary.Null;
        }
示例#2
0
        public static void Dispose()
        {
            _mp3Channel?.Dispose();

            DisposeVst();

            if (_usedLibrary == AudioLibrary.NAudio)
            {
                // NAUDIO
                _samples.Clear();
                if (_playbackDevice != null)
                {
                    _playbackDevice.Stop();
                    _playbackDevice.Dispose();
                    _playbackDevice = null;
                }

                if (_mixer32 != null)
                {
                    _mixer32.Dispose(); _mixer32 = null;
                }
            }
            _usedLibrary = AudioLibrary.Null;
        }