since sound travels using mechanical waves and needs a material medium to propagate and since mechanical waves spread through vibrations ...and since hard materials have their atoms packed closely....they need to vibrate with a smaller amplitude to pass on the wave....thus sound travels faster in a denser medium than a less dense one.