The effect of an acoustically driven bubble on the acoustics of a liquid-filled pipe is theoretically analyzed and the dimensionless groups of the problem are identified. The different regimes of bubble volume oscillations are predicted theoretically with these dimensionless groups. Three main regimes can be identified: (1) For small bubbles and weak driving, the effect of the bubble oscillations on the acoustic field can be neglected. (2) For larger bubbles and still small driving, the bubble affects the acoustic field, but due to the small driving, a linear theory is sufficient. (3) For large bubbles and large driving, the two-way coupling between the bubble and the flow dynamics requires the solution of the full nonlinear problem. The developed theory is then applied to an air bubble in a channel of an inkjet printhead. A numerical model is developed to test the predictions of the theoretical analysis. The Rayleigh-Plesset equation is extended to include the influence of the bubble volume oscillations on the acoustic field and vice versa. This modified Rayleigh-Plesset equation is coupled to a channel acoustics calculation and a Navier-Stokes solver for the flow in the nozzle. The numerical simulations indeed confirm the predictions of the theoretical analysis.