Factors affecting the speed of sound

medium v/m s–1
 air at 0 °C  331
 helium at 0 °C  965
 fresh water at 20 °C  1480
steel  5960
The speed of sound depends on the medium through which the sound is transmitted.

Sound travels faster through media that are more rigid (less elastic).

Even though more rigid materials are more difficult to deform, the deformation snaps back to the equilibrium position more readily.
In general sound travels faster in solids than in liquids than in gases.
Compare the speed of sound in the gases air and helium with the speed in water and steel.

Sound travels faster through media that have lighter particles.

Note that the speed of sound is slower in the gas air than in helium. 
This is because air has heavier particles (N2 and O2 molecules) than the gas helium (He).

The speed of sound does NOT depend on the frequency of the sound.
The wavelength is different for transmission of sound of the same frequency through a given medium.
The wavelength can be calculated from the velocity and frequency of the sound using the same relationship as for other waves (v = f λ).

The speed of sound in gases depends on the temperature as shown by the relationship below that derives from the ideal gass equation.
 
v = γP = γRT   γ ratio of heat capacities
T temperature in kelvin
R ideal gas constant
M molar mass in kg mol–1
ρ M

The particles in the gases are moving more rapidly at higher temperatures, and this increases the speed at which the sound waves are propagated