Velocity of ultrasonic waves in 2H-NbSe2, 2H-TaS2, and 1T-TaS2