When the wave source and the observer are moving toward each other.
The wave compresses increasing the frequency. (Sound is a longitudinal wave)
When the wave source
moves away from the observer, the wavelengths spread out and the frequency
decreases.
Here is an example of the Doppler effect
wave frequency ↑ when
distance ↓