In a moving sound source, wavefronts are compressed ahead of the source. Because each new wave crest is emitted from a position closer to the previous crest in the direction of travel, the wavelength in front becomes shorter and the observed frequency is higher.
This is the sound-wave form of the Doppler effect. A stationary listener hears a higher pitch as a siren approaches and a lower pitch after it passes, because the wavefront spacing changes from the listener’s perspective. The source’s motion is measured relative to the medium carrying the sound, usually air.
The compressed region ahead is not the same thing as a shock wave in every case. If the source reaches or exceeds the speed of sound, the wavefronts pile up into a shock wave and can produce a sonic boom. For an ordinary moving source below the speed of sound, the wavefronts remain distinct but are closer together in front and farther apart behind. Christian Doppler described the general phenomenon in 1842.