Sounds and Physical States
Sound waves travel faster through substances where their molecules are tightly packed together. The sound wave disrupts the molecules closest to the source which, in turn, affect the molecules next to them until the chain reaction reaches your ear. Sounds travel fastest though solids, next fastest through liquids and the slowest through gases. However, the density level of gases can vary greatly, which can have very definite effects on sound waves.
Differences in Density
Helium is one of the lightest gases in the periodic table, weighing in at 4 grams per mole. Air, made up of about 80 percent nitrogen, weighs in at 28 grams per mole, about seven times heavier. Since the gases in air are heavier and denser, they provide more resistance to sound waves, making them travel slower.
Increased Pitch
The muscles in your throat, tongue and vocal cords have developed to speak by air flowing over them. This is why when a lighter density gas, such as helium, is inhaled and travels over the vocal cords, it makes them vibrate at an increased rate of speed, leading to a seemingly higher-pitched voice.
Room Full of Helium
The perceived increased pitch produced from speaking, after inhaling helium, also has to do with the contrast of the sound produced, then reacting with heavier sound waves en route to the listener's ear. If both the speaker and the listener were in a room full of helium, instead of air, the sound waves would travel faster through the room, but a difference in pitch would not be perceived.