How does density affect the speed of sound?

Sound travels faster in a more dense material.