> [The speed of sound] is affected by the density of the air (which is a combination of the air pressure and temperature)...
This is incorrect. The speed of sound in an ideal gas is a function of temperature only, and not its density. Namely, it is sqrt(gamma x R x T), where R and gamma are unchanging properties of the gas.