Dependence on the properties of the medium
The speed of sound is variable and depends on the properties of the substance through of which the wave is travelling. In solids, the speed of longitudinal waves depend on the stiffness to tensile stress, and the density of the medium. In fluids, the medium's compressibility and density are the important factors.
In gases, compressibility and density are related, making other compositional effects and properties important, such as temperature and molecular composition. In low molecular weight gases, such as helium, sound propagates faster compared to heavier gases, such as xenon (for monatomic gases the speed of sound is about 75% of the mean speed that molecules move in the gas). For a given ideal gas the sound speed depends only on its temperature. At a constant temperature, the ideal gas pressure has no effect on the speed of sound, because pressure and density (also proportional to pressure) have equal but opposite effects on the speed of sound, and the two contributions cancel out exactly. In a similar way, compression waves in solids depend both on compressibility and density—just as in liquids—but in gases the density contributes to the compressibility in such a way that some part of each attribute factors out, leaving only a dependence on temperature, molecular weight, and heat capacity (see derivations below). Thus, for a single given gas (where molecular weight does not change) and over a small temperature range (where heat capacity is relatively constant), the speed of sound becomes dependent on only the temperature of the gas.
In non-ideal gases, such as a van der Waals gas, the proportionality is not exact, and there is a slight dependence of sound velocity on the gas pressure.
Humidity has a small but measurable effect on sound speed (causing it to increase by about 0.1%-0.6%), because oxygen and nitrogen molecules of the air are replaced by lighter molecules of water. This is a simple mixing effect.
http://en.wikipedia.org/wiki/Speed_of_sound