In an ideal gas, the speed of sound is independent of pressure. This isbecause both pressure and density vary in such a way that their ratio remainsconstant at a given temperature, due to the ideal gas law , where is the specificgas constant and is the temperature.