An audio codec is provided, comprising an analog to digital converter (ADC) operable to receive an analog input signal for producing a first digital signal, and a first decimator down samples the first digital signal to generate a first intermediate signal. A second decimator receives a second digital signal from a digital microphone and down sample the second digital signal to generate a second intermediate signal. A multiplexer selects either the first intermediate signal or the second intermediate signal as a selected signal based on a control signal. A third decimator down samples the selected signal to generate a down sampled signal. A data formatter produces a digital output signal based on the down sampled signal.