This article is from the Acoustics FAQ, by Andrew Silverman with numerous contributions by others.
The speed of sound in air at a temperature of 0 degC and 50% relative humidity is 331.6 m/s. The speed is proportional to the square root of absolute temperature and it is therefore about 12 m/s greater at 20 degC. The speed is nearly independent of frequency and atmospheric pressure but the resultant sound velocity may be substantially altered by wind velocity.
A good approximation for the speed of sound in other gases at standard temperature and pressure can be obtained from
c = sqrt (gamma x P / rho)
where gamma is the ratio of specific heats, P is 1.013E5 Pa and rho is the density.
The speed of sound in water is approximately 1500 m/s. It is possible to measure changes in ocean temperature by observing the resultant change in speed of sound over long distances. The speed of sound in an ocean is approximately:
c = 1449.2 + 4.6T - 0.055T^2 + 0.00029T^3 + (1.34-0.01T)(S-35) + 0.016z
T temp in degrees Celsius, S salinity in parts per thousand z is depth in meters
See also CRC Handbook of Chemistry & Physics for some other substances and Dushaw & Worcester JASA (1993) 93, pp255-275 for sea water.
 
Continue to: