The invention relates to a method for determining the proportion of molecular oxygen in a respiratory gas, for example in lung function diagnostics, comprising the introduction of the respiratory gas into a measurement tube, transmitting a sound signal by means of a sound transmitter and receiving the sound signal by means of a sound receiver, defining a sound measurement zone by means of the sound transmitter and the sound receiver, determining the average molar mass of the respiratory gas by means of a sound propagation time measured over the measurement zone, and determination of the carbon dioxide content of the respiratory gas with a carbon dioxide gas sensor. The invention also relates to a device for performing the method.