A finite element heterogeneous multiscale method (FEHMM) is proposed for the time dependent wave equation with highly oscillatory, albeit not necessarily periodic, coefficients. It is based on a finite element discretization of an effective wave equation at the macro scale, whose a priori unknown effective coefficients are computed “on the fly” on sampling domains within each macro finite eleme...