Answer:
Because of the different wave speed from light and sound.
Step-by-step explanation:
There is a major difference between the speed wave of light and sound, light travels at 186, 282 miles per second, and sound can travel at different speeds and its significantly slower so it is easier to measure it. Water become more dense when cold, and its density decreases as its temperature increases, so if you know the velocity on air of a certain sound, you can determine the temperature of the medium by studying the increase or decrease of the speed in that given medium.