From Laplace’s formula
v = √(γP/ρ)
Since density is ratio of mass per unit volume,
v = √(γPV/M)
Using the equation of state PV = nRT, where n is number of moles in mass m of the gas
v = √(γRT/m)
Where m denotes the gram molecular mass. This result shows that
v ∝ √T
For small temperature variations, velocity of sound in air increases by 0.61 ms–1 with every degree celsius rise in temperature.
When you increase pressure on a gas, it gets compressed but its density increases in the same proportion as the pressure i.e. P/ρ remains constant. It means that, pressure has no effect on the velocity of sound in a gas.
If you consider two gases under identical conditions of temperature and pressure, then
v ∝ 1/√ρ
As humidity in air increases (keeping conditions of temperature and pressure constant), its density decreases and hence velocity of sound in air increases.