Putting that aside, in an ideal gas, the speed of sound depends on the composition of the gas and the temperature and, interestingly, does not depend on pressure, and pressure is the main way that the altitude would affect the speed of sound. So measuring the speed of sound in air actually makes for a pretty good thermometer.
"The speed has a weak dependence on frequency and pressure in ordinary air, deviating slightly from ideal behavior."
"The speed of sound is raised by humidity. The difference between 0% and 100% humidity is about 1.5 m/s at standard pressure and temperature, but the size of the humidity effect increases dramatically with temperature."
"Slight" can matter significantly in an application like this.
This has little do with the behavior of sound. The fraction of the air that consists of water vapor at 100% relative is very small at cool temperatures and increases to 100% at 100 degrees C.
(Yes, water boils at the temperature at which air that is saturated with water vapor is all water vapor.)
https://courses.lumenlearning.com/suny-physics/chapter/13-3-...
An ideal gas’ pressure is a function of number of particles per unit volume, its temperature, and nothing else. If you do anything involving adding or removing heat or changing the volume or pressure, you probably also need to know the specific heat at constant volume and the specific heat at constant pressure or, frequency, their ratio. That ratio is called the adiabatic index or the heat capacity ratio, it’s written as gamma, and it’s the last parameter in the speed of sound of an ideal gas. Interestingly, it doesn’t vary all that much between different gasses.
In practice most microphones measure the displacement of microscopic membranes, which are deformed by the air pressure. The next question then becomes how to measure microscopic movements of a tiny membrane. Turns out the membrane forms part of a capacitor and the electrical characteristics of capacitors depend on their geometry.
There are at least 4 different types of microphones. Condenser which does in fact form part of a capacitor, dynamic which is effectively a linear generator (coil attached to membrane), ribbon which is a change in resistance as a small ribbon flexes and piezoelectric which is some black magic witg crystals
There are also some exotic principles like laser or radar microphones using interferometry.
For me I see a lot more dynamic than condensers but I guess if you are talking about what is in like every single IOT thingamabob then you might be right there.
I find this to all be in the realm of "I don't believe you that any of this works at all" if I didn't have a lifetime of experience with the fruits of successfully-functioning microphones.