Sound waves are produced by vibration that causes the molecules of a medium to form alternating high- and low-pressure fronts. These waves can travel through solids, liquids and sufficiently dense gases.
As an object, such as a piano string, vibrates, it sets the air around it into motion. The vibration alternately compresses and rarefies the air around it. These compression waves then propagate out from the source in three dimensions at the local speed of sound. Dense media allow sound waves to travel faster than thin media, which is why sound travels faster through metal or water than it does through air.