Sound propagation near magnetic phase transitions