What determines the size of features on the CMB? I have been learning about baryon acoustic oscillations. I am however confused about the size of the features as seen on the CMB. 
It is claimed that the largest structures have a size given by the distance sound waves could have traveled through the baryon-photon gas by the time of recombination. This is the integral of the speed of sound over time.
Alternatively, as I have been picturing it, if we have an infinite gravitational well that is flat at the bottom, then we have the particle in a box potential from quantum mechanics. Here the sound waves can only travel at most the size of the box. Allowing the potential well to be finite and smoothly curved can only smoothly deform the harmonic solutions of the infinite well. Thus the scale is still set by the size of the well and not the distance sound can travel in free space.
So how are these two ideas compatible?
 A: By the time of baryonic plasma one cannot apply even effective quantum mechanics to gravitation. One is dealing with macroscopic classical physics, that is why acoustic waves, which need a varying pressure gradient , are appropriate in the mathematical description.
The gravitational potential well is a classical gravitational well. Think of a water asteroid. It is held together by the gravitational forces of its mass, in a gravitational potential well. The limits of the potential well in space are the surface of this water asteroid. Vibrations can move  through the volume from surface to surface of this asteroid.
This is the analogue for cosmic acoustic waves . Gravitational masses within various  volumes,  generating  collective classical gravitational potential wells.

Imagine an overdense region of the primordial plasma. While this region of overdensity gravitationally attracts matter towards it, the heat of photon-matter interactions creates a large amount of outward pressure. These counteracting forces of gravity and pressure created oscillations, analogous to sound waves created in air by pressure differences

Velocity of "sound" comes in in a similar way that velocity of sound comes in the analogue of the water asteroid. The limits are the limits of the volume surface which define the distance where this sound can resonate.
