Dynamics of a weakly nonlinear and weakly dispersive flow of a gas where molecular vibrational relaxation takes place is studied. Variations in the vibrational energy in the field of intense sound is considered. These variations are caused by a nonlinear transfer of the acoustic energy into energy of vibrational degrees of freedom in a relaxing gas. The final dynamic equation which describes this is instantaneous, it includes a quadratic nonlinear acoustic source reflecting the nonlinear character of interaction of high-frequency acoustic and non-acoustic motions in a gas. All types of sound, periodic or aperiodic, may serve as an acoustic source. Some conclusions about temporal behavior of the vibrational mode caused by periodic and aperiodic sounds are made.