The speed of a wave alters when the wave comes into contact with a different medium.
In general, the speed of a wave is determined by the properties of the medium through which it is traveling. When a wave transitions from one medium to another (for example, from air to water), the speed can change due to differences in density and elasticity of the two media.