The photoacoustic signal generated in a photoacoustic gas cell with rigid wall boundaries is calculated by solving the coupled equations for sound propagation and thermal diffusion in a viscous and relaxing gas. For a cylindrical geometry, monochromatic radiation, and sinusoidal modulation, when a condition of zero heat flow through the lateral walls of the cell is verified, a general expression is found that can be applied whatever the deactivation scheme is for collisional relaxation in the gas. Both resonant and nonresonant modes of operation are considered.