The speed of sound $v$ in a material is given by: $$ v = \sqrt{\frac{B}{\rho}},$$ where $B$ is the bulk modulus (quantifying how easily compressible the medium is) and $\rho$ the density of the medium. This formula applies for "normal" propagation away from the source. In this region, we can assume $\rho$ and $B$ to be constant. Sound is an *oscillation* of the air (or whatever medium) molecules, i.e. a sequence of rarefactions and compressions: [![enter image description here][1]][1] The *amplitude* of the oscillation is what gives sound *volume*: a large amplitude means a great difference in pressure between the compressed and rarefied region, i.e. a big force on the eardrum, which causes pain and possible rupture. This amplitude is dictated by the initial energy of the event creating the sound wave, in this case the explosion of the firecracker. But it does not necessarily change the speed of sound itself. Think of an harmonic oscillator (I'll try and make a gif later): [![enter image description here][2]][2] The *period* (*frequency*) of oscillation is always the same. A higher kinetic energy of the particle just causes a larger *amplitude* of the oscillation, i.e. the ball has a higher turning point. But it takes the same time to cover an entire period. So a more powerful firecraker results in a larger amplitude of the oscillation, i.e. a louder sound and a stronger pressure differential between compressions and rarefactions. Away from the source, however, the speed of this oscillation is the always the same. As for the period of a harmonic oscillator. ### Close to the source: shock waves I said earlier that away from the source you can take the density $\rho$ of the medium constant. I.e. the source does not change the characteristics of the medium itself. Close to the source of the explosion, you cannot. The abrupt release of energy in a limited space can dramatically alter the characteristics of the medium, such as its density. This leads to *shock waves*: [![enter image description here][4]][4] The "expansion wave" is basically what I call "away from the source". The shock waves cause a rapid change in the density of air $\rho$, which result in a change of refractive index, like in here: [![enter image description here][3]][3] [1]: https://i.sstatic.net/IahAc.png [2]: https://i.sstatic.net/dq392.png [3]: https://i.sstatic.net/x287h.png [4]: https://i.sstatic.net/Z5VZV.png [5]: https://i.sstatic.net/jBcBm.jpg