Phase-shifting interferometry is one of the optical measurement techniques that improves accuracy and resolution by incorporating a controlled phase shift into conventional optical interferometry. In this study, a four-step phase-shifting interferometer is developed to measure the spatiotemporal distribution of acoustic density oscillations of the gas next to a rigid plate. The experimental apparatus consists of a polarizing Mach-Zehnder interferometer with a polarization camera capable of capturing four polarization directions in one shot image and it is used to measure the magnitude and the phase of density fluctuations through a duct of rectangular cross section connected to a loudspeaker. The results are compared with the well-established thermoacoustic theory describing the thermal coupling between acoustic oscillations and rigid boundaries, and the results show a very good agreement for various ratios of the (frequency-dependent) thermal boundary layer thickness to the plate spacing. This measurement technique could be advantageously employed to analyze more complex heat transfer processes involving the coupling of acoustic oscillations with rigid boundaries.