Phase shift by arduinofft is not corrected

The time is measured between the first sample on microphone 1 (sample set 1) and the first sample on microphone 2 (sample set 2). Divide that by the frequency to see the phase difference between the two sample sets. I think you then add the three phases: phase at microphone 1 (sample set 1), difference in phase between the two sets of samples, and phase at microphone 2 (sample set 2). That should give you a phase difference between the two microphones.