$$v = 331 \sqrt{\frac{T}{M}}$$
where:
\(v\) = speed of sound (m/s)
\(T\) = temperature (K)
\(M\) = molar mass (g/mol)
As the temperature increases, the speed of sound also increases. As the molar mass increases, the speed of sound decreases. Density is not a factor in the calculation of the speed of sound.