public void ResetDecoder(bool isFullReset)
 {
     if (_preparedLength > 0)
     {
         SaveBuffer();
     }
     if (isFullReset)
     {
         _noExecuteChannel = new bool[_channels];
         _floorData        = new VorbisFloor.PacketData[_channels];
         _residue          = new float[_channels][];
         for (int i = 0; i < _channels; i++)
         {
             _residue[i] = new float[Block1Size];
         }
         _outputBuffer          = new RingBuffer(Block1Size * 2 * _channels);
         _outputBuffer.Channels = _channels;
     }
     else
     {
         _outputBuffer.Clear();
     }
     _preparedLength = 0;
 }
示例#2
0
 private void InitDecoder()
 {
   if (this._outputBuffer != null)
     this.SaveBuffer();
   this._outputBuffer = new RingBuffer(this.Block1Size * 2 * this._channels);
   this._outputBuffer.Channels = this._channels;
   this._preparedLength = 0;
   this._currentPosition = 0L;
   this._resyncQueue = new Stack<DataPacket>();
   this._bitsPerPacketHistory = new Queue<int>();
   this._sampleCountHistory = new Queue<int>();
 }
示例#3
0
        void InitDecoder()
        {
            if (_outputBuffer != null)
            {
                SaveBuffer();
            }

            _noExecuteChannel = new bool[_channels];
            _floorData = new VorbisFloor.PacketData[_channels];

            _residue = new float[_channels][];
            for (int i = 0; i < _channels; i++)
            {
                _residue[i] = new float[Block1Size];
            }

            _outputBuffer = new RingBuffer(Block1Size * 2 * _channels);
            _outputBuffer.Channels = _channels;

            _preparedLength = 0;
            _currentPosition = 0L;

            _resyncQueue = new Stack<DataPacket>();

            _bitsPerPacketHistory = new Queue<int>();
            _sampleCountHistory = new Queue<int>();
        }
示例#4
0
        void ResetDecoder(bool isFullReset)
        {
            // this is called when:
            //  - init (true)
            //  - parameter change w/ stream header (true)
            //  - parameter change w/o stream header (false)
            //  - the decoder encounters a "hiccup" in the data stream (false)
            //  - a seek happens (false)

            // save off the existing "good" data
            if (_preparedLength > 0)
            {
                SaveBuffer();
            }
            if (isFullReset)
            {
                _noExecuteChannel = new bool[_channels];
                _floorData = new VorbisFloor.PacketData[_channels];

                _residue = new float[_channels][];
                for (int i = 0; i < _channels; i++)
                {
                    _residue[i] = new float[Block1Size];
                }

                _outputBuffer = new RingBuffer(Block1Size * 2 * _channels);
                _outputBuffer.Channels = _channels;
            }
            else
            {
                _outputBuffer.Clear();
            }
            _preparedLength = 0;
        }
示例#5
0
        void InitDecoder()
        {
            if (_outputBuffer != null)
            {
                SaveBuffer();
            }

            _outputBuffer = new RingBuffer<float>(Block1Size * 2 * _channels);
            _outputBuffer.Channels = _channels;

            _preparedLength = 0;
            _currentPosition = 0L;

            _resyncQueue = new Stack<DataPacket>();

            _bitsPerPacketHistory = new Queue<int>();
            _sampleCountHistory = new Queue<int>();
        }