A sound wave is impacted most by temperature, then depth and then salinity. As any one of those factors increases, the speed of sound increases. Generally speaking, as water temperature decreases, refraction increases.
As water temperature decreases, the speed of sound also decreases. At 68° fahrenheit, the speed of sound through water is about 4,800 fps. In places like the Caribbean or the Persian Gulf, where the water is very warm, the speed of sound increases. Go to the Flemish Cap and it slows.
We used to use an expendable bathythermograph, or XBT, to measure temperature, pressure and salinity in order to do what was known as "range predictions":
The range predictions would tell you, more or less, what the effective ranges of the sonar would be when operated in different active modes, as well as when operated passively. I've long since forgotten the formulas we used (I haven't done an XBT drop in 25 years), but the resulting range predictions would then get posted on the bridge and near the ASW fire control panel...