Nonlinear resonant gas oscillations in closed ducts are investigated by solving a previously derived, quasi-one-dimensional, nonlinear wave equation that accounts for forcing, gas dynamic nonlinearities, and viscous dissipation. This equation is solved with the approximate Galerkin method to determine the dependence of driven oscillations upon the duct shape, forcing frequency, and forcing amplitude. Initially, the applicability of the developed Galerkin solution approach was studied by investigating oscillations in a straight duct, closed at both ends and periodically oscillated at a single frequency. It is shown that the Galerkin method predictions of shock wave-like oscillations in such ducts are in excellent agreement with results obtained with other numerical solution techniques. Next, this study investigated the forced response of a class of horn-shaped ducts, and it is shown that for a given forcing amplitude, there exists a nonmonotonic increase in compression ratio as the duct's flare constant is increased. Finally, it is shown that oscillations driven in ducts whose shapes were chosen to provide shifting of the second and third natural acoustic mode frequencies exhibit significant waveform distortion and non-negligible increases in compression ratio when compared with oscillations driven in straight ducts.