DSPUtil.SoundBuffer.ToDoubleArray C# (CSharp) Method

ToDoubleArray() public method

Return the buffer contents as an array of doubles
public ToDoubleArray ( int startPos, int count ) : double[][]
startPos int
count int Length of the return array (will be null-padded if count exceeds data size)
return double[][]
        public double[][] ToDoubleArray(int startPos, int count)
        {
            int n = count;
            if (count < 0)
            {
                ReadAll();
                n = _samples.Count - startPos;
            }
            else
            {
                ReadTo(startPos + count);
                n = Math.Min(startPos + count, _samples.Count);
            }
            double[][] ret = new double[NumChannels][];
            for (int c = 0; c < NumChannels; c++)
            {
                ret[c] = new double[count<0 ? n : count];
            }
            for (int j = startPos; j - startPos < n; j++)
            {
                ISample s = _samples[j];
                for (int c = 0; c < NumChannels; c++)
                {
                    ret[c][j - startPos] = s[c];
                }
            }
            return ret;
        }

Same methods

SoundBuffer::ToDoubleArray ( ) : double[][]
SoundBuffer::ToDoubleArray ( int startPos ) : double[][]