Is the speed of sound constant? I was looking at lightning, and started to wonder if the speed of the thunder slowed down as it lost energy traveling far distances.  I know the amplitude of sound decreases, perceived as volume.  Im not certain, however, how to actually calculate the distance of a lightning strike based off of of the interval of time between observing  the flash and hearing the thunder.  Would this time be linear ( is the speed of sound constant?), or is it non-linear (Speed of sound loses velocity over time?)
If I were to determine this by comparing two audio recordings of the same lightning strikes' thunder, and seeing if the further one was lower in frequency, would that accurately indicate a deceleration of the sound?
 A: Strictly speaking, the thunder propagation velocity does decrease with distance, as initially lightning generates a shock wave in air, whose propagation velocity is higher than the velocity of sound, however, such shock waves get weaker with distance and become ordinary sound waves at a distance of just about 10 m from the lightning (http://lightningsafety.com/nlsi_info/thunder2.html). For a nuclear blast, this effect of shock wave deceleration with distance is much more significant. See the relevant formulas at https://www.metabunk.org/attachments/blast-effect-calculation-1-pdf.2578/
A: for lightning bolts in air, the speed of sound of the thunder will not change with distance. So to estimate the distance to the lightning, you start to count 0,1,2,3,4... at the instant you see the flash.  If you hear the thunder at the count of 5 (5 seconds after you saw the flash) it means the lightning was about 5,000 feet away because the sound travels about 1,000 feet in one second and the relationship is linear. 
