JTF > Demo Gallery > assignments > DopplerSiren

 
This assignment helps students understand and use the facilities of the SoundClip class in the acm.util package by having them simulate a siren that first approaches the listener and then recedes. The intensity changes depending on the distance and shifts from the left stereo channel to the right stereo channel as the siren passes. The pitch, moreover, is subject to a Doppler shift and therefore becomes lower as the siren moves away.