private void StopReadBuffer()
 {
     lock (_readBufferLock)
     {
         // Under lock so OnAudioFilterRead won't use the buffer while/after it is disposed.
         _readBuffer.Dispose();
         _readBuffer = null;
     }
 }
        // Must be called within Unity main thread.
        private void StopStreaming()
        {
            _isLive = false;
            AudioStreamStopped.Invoke(this);
            IsStreaming = false;

            lock (_readBufferLock)
            {
                // Under lock so OnAudioFilterRead won't use the buffer while/after it is disposed.
                _readBuffer.Dispose();
                _readBuffer = null;
            }
        }