public void Process(float[][] input, long samples, bool final) { for (int i = 0; i < input.Length; i++) { if (input[i].Length < samples) { throw new Exception("Invalid input data: Channel " + i + " does not have " + samples + " samples of data"); } } long totalSamples = input.Length * samples; if (totalSamples > _processBuffer.Length) { _processBuffer = new float[totalSamples]; } for (int i = 0; i < input.Length; i++) { Array.Copy(input[i], 0, _processBuffer, i * samples, samples); } RubberBandNativeMethods.RubberBandStretcher_Process(_rbs, _processBuffer, new IntPtr(samples), input.Length, final); }