When sound waves pass from a denser medium to a less dense medium, such as from a solid to air, they undergo a phenomenon called refraction. Refraction causes the direction of the sound wave to change, and its speed also changes as it enters the new medium.
In the case of sound traveling from a denser medium to a less dense medium, such as from a solid to air, the sound wave generally speeds up. This is because sound waves travel faster in less dense mediums. However, it's important to note that this change in speed occurs at the boundary between the two mediums, and it does not imply a temporary increase in speed within the same medium.
To draw an analogy with a car, it is more like taking your foot off the brake and coasting downhill. The car gains speed as it moves to a lower elevation, but there is no continuous acceleration once it reaches a constant speed.
In the context of sound passing through an air gap between walls, the sound waves will speed up as they leave the denser material (such as a wall) and enter the less dense air. However, this increase in speed happens at the boundary and does not result in a continuous acceleration or change in speed while propagating through the air gap.
It's worth noting that the speed of sound is also affected by the temperature and humidity of the medium it is traveling through. So while the general trend is for sound to speed up in less dense mediums, other factors may come into play in specific situations.