Welcome to our site! Electro Tech is an online community (with over 170,000 members) who enjoy talking about and building electronic circuits, projects and gadgets. To participate you need to register. Registration is free. Click here to register now.
The signal integrity of sound through air is not very good: there is noise, reflection, frequency-dependent attenuation etc. For this reason, it's generally not practical to directly measure the arrival time of edges as you might in the electrical domain (in time-domain reflectometry, for example).
Instead, what is normally done is to inspect the cross-correlation of the transmitted and received sound. You will see a spike in the cross-correlation function at the point where the offset between the two waveforms equals the time-of-flight between the transmitter and receiver.
Of course, this relies on you knowing what sound was transmitted. Will you be in control of the sound that is produced, or is it going to come from an external source?
It also works better with a stimulus sound which is periodic over a period significantly longer than the expected time-of-flight. A maximum length sequence is often used for this, although music can also be good.