Well all that is needed is to make sure you have the right number of samples. Because of the use of FFT, you need a power of two. So you could set up your buffer sizes carefully so that each DataAvailable has exactly the right number of samples, or you could use a CircularBuffer and when you have enough pass a chunk of samples into the AutoCorrelator. Use Buffer.BlockCopy to go from byte[] to float[] (assuming you are recording in mono)
↧