The energy decay of solutions to the initial-boundary value problem for the wave equation in an inhomogeneous medium