Sound is the result of molecules interacting or disturbing one another, so sound does not travel at the same speed through different materials because there are varying amounts of room between the molecules of different types of materials. For example, sound travels about 17 times faster when going through metal than it does through air — more than 10,000 mph (16,093 km/h) through metal, compared with about 761 mph (1,224 km/h) through air. In water, sound travels about four times faster than through air, at about 3,000 mph (4,828 km/h). Sound travels more slowly through air because air consists mainly of nitrogen and oxygen, whose molecules are not arranged as rigidly as those in materials such as water or steel. The more rigidity in a material, the faster sound travels because the molecules interact with one another more.
More about the speed of sound: