We consider an initial-boundary value problem for the n-dimensional wave equation, n >= 2, with the variable sound speed with the nonhomogeneous Dirichlet boundary conditions. We construct and study three-level in time and compact in space three-point in each spatial direction alternating direction implicit (ADI) schemes having the approximation orders O(h(t)(2) + vertical bar h vertical bar(4)) and O(h(t)(4) + vertical bar h vertical bar(4)) on the uniform rectangular mesh. The study includes stability bounds in the strong and weak energy norms, the discrete energy conservation law and the error bound of the order O(h(t)(2) + vertical bar h vertical bar(4)) for the first scheme as well as a short justification of the approximation order O(h(t)(4) + vertical bar h vertical bar(4)) for the second scheme. We also present results of numerical experiments. (C) 2021 Elsevier Inc. All rights reserved.