/// <summary>
        /// Flush the transfer buffer to the encoded audio buffer.
        ///
        /// THIS IS NOT THREAD SAFE! Don't call this once playback has started.
        /// </summary>
        public void FlushTransferBuffer()
        {
            // empty the transfer buffer into the decoder buffer
            VoicePacket frame;
            while (_inputBuffer.Read(out frame))
                _source.Push(frame);

            // set the complete flag after flushing the transfer buffer
            if (_complete && !_sourceClosed)
            {
                _sourceClosed = true;
                _source.Stop();
            }
        }
Example #2
0
        private void FlushTransferBuffer()
        {
            // empty the transfer buffer into the decoder buffer
            EncodedAudio frame;

            while (_inputBuffer.Read(out frame))
            {
                _source.Push(frame);
            }

            // set the complete flag after flushing the transfer buffer
            if (_complete && !_sourceClosed)
            {
                _sourceClosed = true;
                _source.Stop();
            }
        }