Factors affecting the speed of sound in a gas