The physics
Sound is a wave of squeezes and stretches. It needs a medium: a solid, a liquid or a gas. It cannot cross empty space.
An echo goes to a wall and comes back. So it covers twice the distance.
t = 2d / v
The air layers swing to and fro. Where they crowd together, the pressure rises. The pressure swing is largest where the displacement is zero.
s = s₀ sin(ωt − kx) p₀ = B k s₀
The speed depends on how stiff the medium is and how dense it is.
rod: v = √(Y / ρ) liquid or gas: v = √(B / ρ)
Newton took B = P for a gas. Real squeezes are too fast for heat to flow. So B = γP. This is Laplace's fix.
v = √(γP / ρ) = √(γRT / M)
At one temperature, P/ρ stays the same. So pressure alone does not change the speed. A warmer gas carries sound faster, as √T in kelvin. A lighter gas carries it faster too.