Solution to Cross-correlation problem of 2 audio signals
Having looked at how xcorr is defined I think I know what is happening.

There are two issues:


The range of xcorr is $2N-1$ (N = length of signal X). The initial values are for negative shifts and the second half is positive shifts. Therefore subtract 120000 to get the correct shift.
xcorr pads Y with zeros to the same length as X. The first 20000 points will be sample Y and the rest of the data zeros. Therefore the value of the maximum correlation will be the start point, not the mid point of the signal (as I originally thought). To prove this think what would happen if Y was the beginning of signal X.


If we now do this on your data we get a start point of (172000-12000)/8000=6.5seconds as expected. The 0.0001 sec comes from how you've defined the first point in time.

However, this is a pretty bad way to do it as any noise in the signal Y will cause your algorithm to fail. I suspect the aim of this task is to manually right code to calculate the correlation function in a similar way to corr does and then find the maximum.