The speed of a wave alters when the wave comes into contact with a different medium.
When a wave travels from one medium to another (for example, from air to water), its speed may change due to the differences in the properties of the two media, such as density and elasticity.