The frequency of the sound waves determines the pitch. Sound travels at a constant velocity of 340.29 m/s, but since the wavelength of the sound wave can change, so can the frequency. When an object is stationary, the sound waves that emanate from the object all have the same wavelength, and so therefore have the same frequency. But when an object is moving, the wavelengths of the sound waves moving in the same direction as the object shorten, resulting in the a higher frequency. You perceive this as a higher-pitched sound. After the object passes you and begin to move away, the wavelengths lengthen, resulting in a lower frequency and pitch.
The Doppler Effect is the sound of this transition from high to low pitch as a result of the object’s movement. The same concept applies to breaking the sound barrier. When an object moves at 340.29 m/s, it is traveling at the speed of sound. Once it moves faster than the speed of sound, the waves overlap, resulting in constructive interference. This is what creates a sonic boom.
When one begins to understand how sound works, it becomes evident that sound is not always what it seems. Suppose you’re driving, and your favorite song comes on the radio. You begin singing at the top of your lungs, at a note you perceive to be 465 Hz. But a passerby hears the note at 473 Hz. What you perceive to be 465 Hz is as true as the passerby’s perception of it being 473 Hz. The same sound can be perceived in an infinite number of ways, depending on the motion of the object and the one perceiving it. So really, sound comes down to perception.
Of course, only in relation to pitch. The loudness and timbre are not controlled by motion. The speaker controls that.