Waves must be distinguished as to what medium they are traveling through, if you want to make any sense of data.
Sound will travel at a certain rate in air and another in water, and these rates can be quite different.
Materials have something called the bulk modulus which has to do with elasticity and the ease with which waves propagate through a particular substance.
Lightning goes through the air at about 1/5 mile/sec, and therefore you can count the seconds between the flash and the sound to determine how far away the lightning struck.
Temperature also affects the bulk modulus, so it should be taken into account for better precision.