We study an initial boundary-value problem for a waveequation with time-dependent sound speed. In the control problem,we wish to determine a sound-speed function which damps thevibration of the system. We consider the case where the sound speed cantake on only two values, and propose a simple control law. We showthat if the number of modes in the vibration is finite, and none ofthe eigenfrequencies are repeated, the proposedcontrol law does lead to energy decay. We illustrate the rich behaviorof this problem in numerical examples.