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)); }
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); }