The speed of a wave depends solely on the medium. It is common knowledge that sound travels faster underwater than through air; but, contrary to what logic tells us, sound also travels faster through salt water than through fresh water. Usually, the rule of thumb is that sound travels slower in a denser medium of the same phase. But why would sound travel faster in salt water if it is denser?
It's because of the difference in bulk modulus. "The bulk modulus of a substance measures the substance's resistance to uniform compression. It is defined as the ratio of the infinitesimal pressure increase to the resulting relative decrease of the volume." So basically bulk modulus is the measure of how hard it is to compress a substance.
The speed of sound decreases in water with increased density, but increases in water with increasing bulk modulus. Therefore, because salt water is more resistant to compression, sound travels through it faster.