Пример #1
0
        public int Read(float[] buffer, int offset, int count)
        {
            lock (FftQueue)
            {
                float[] buf = new float[count];
                Array.Copy(buffer, offset, buf, 0, count);
                FftQueue.Enqueue(buf);
            }

            return(sampleProvider.Read(buffer, offset, count));
        }
Пример #2
0
        public int Read(float[] buffer, int offset, int count)
        {
            int read = prov.Read(buffer, offset, count);
            int fftc = 0;

            foreach (var fft in FftQueue)
            {
                fftc += fft.Length;
            }

            fftc += count;
            FftQueue.Enqueue(buffer.Take(read).ToArray());

            int len = LeftOver == null ? 0 : LeftOver.Length;

            if (fftc + len >= NumberOfSamples)
            {
                ComputeFFT();
            }

            return(read);
        }