Estimating the time offset (delay) between two audio signals in real-time I'm looking for an algorithm which can accurately estimate the time-offset/delay between two audio signals in real-time. One audio signal is a loudspeaker signal and the other signal is the microphone signal. 

Audio is processed in blocks of 10ms (sample frequency 16kHz).


There is light office noise embedded in the signals
The algorithm must be able to estimate delays up to 500ms.
The delay is usually constant for a period of time (with some variability -10ms to 10ms), but occasionally the delay "jumps". Those sudden jumps can be in the order of 50 to 80 ms. The algorithm must be able to handle that.


I've read that GCC PHAT is one algorithm which can be used, but I'm not sure how it would work in a real-time environment.
There are a variety of techniques available. See this thesis for a nice write-up.  

See the list of algorithms:



In particular, note that they recommend pre-whitening the signals before correlation --- to ensure that the cross-correlation has a nice, narrow peak for better "localization".