When an object vibrates, it causes slight changes in air pressure. These air pressure changes travel as waves through the air and produce sound. ... In gases, the higher the velocity of sound, the higher the pitch will be (Remember the "Mickey Mouse" sound when people talk after inhaling helium gas?).
It is because pressure and density both contribute to sound velocity equally, and in an ideal gas the two affects cancel out, leaving only the effect of temperature. Sound usually travels more slowly with greater altitude, due to reduced temperature.