public void SetSize(int numChannels, int numSamples)
        {
            if (numChannels > _numChannels || numSamples > _numSamples || _allocatedBlock == FloatHeapBlock.Zero)
            {
                _allocatedBlock.Dispose();
                _numSamples  = numSamples;
                _numChannels = numChannels;

                var size = numChannels * numSamples;
                if (size > 0)
                {
                    _allocatedBlock = new FloatHeapBlock(size);

                    _channels = new float *[numChannels];
                    for (var i = 0; i < numChannels; ++i)
                    {
                        _channels[i] = _allocatedBlock + i * _numSamples;
                    }
                }
                else
                {
                    _channels = null;
                }
            }
        }
Beispiel #2
0
 public bool Equals(FloatHeapBlock other)
 {
     return(this == other);
 }