The speed of sound depends on the elasticity and density of the medium through which it is traveling. Air and hydrogen have nearly the same elastic properties, but the density of hydrogen is less than that of air. Hence sound travels faster in hydrogen than in air.