High-resolution finite-volume methods for acoustic waves in periodic and random media