I've been doing experiments related to this back in 1994, so it's going to take a bit of recall.
The idea of a flute is that you create standing waves, which have a frequency that depends on the (variable) geometry. The reason they're standing waves is because you fix specific boundary conditions. In particular, p=0 at an open end.
Now, consider that you have a standing wave in a flute, with an wavelength that is a fraction of your flute length. That means that you have several nodes in the middle. If you would open a key at a node, there would be no effect. If you'd open one near a node, the pitch would change slightly.
What you did actually is the so-called horn loudspeaker. And what horns do is to narrow the propagation of sound produced by the loudspeaker. Conventional loudspeaker propagates a lot of sound up, down, left, right, etc. in relation to the axis of the cone. Horns concentrate the sound along the axis, which is therefore louder for the listener (if not located extremely to the side). That's why the police or other people who want to communicate in open space use such devices.
More technically (physically) speaking, given the displacement of the driver in your speaker (which does not change as you put the horn to it) the small cross-sectional area of the horn restricts the passage of air, which means increased air pressure in the direction of the listener as compared to your loudspeaker without the added horn, and increased pressure means increased sound volume.
As Carl Witthoft below suggested (thank you) another contributor to the higher efficiency of horn loudspeakers is the fact that they are better matching acoustical impedances of the source of the sound and the so-called load (air). The higher pressure increases the external impedance - which is naturally low due to low air density - to (better) match the impedance of the source. In (conventional) direct radiating loudspeakers this mismatch leads to a lot of energy being converted to heat within the driver instead of into the sound wave.
This has also some positive "side-effects". If designed and manufactured properly, i.e. when you are concerned mostly with the sound quality and not just with the loudness produced (which is not always the case, as you might have noticed with the police devices), horns contribute to better efficiency of the loudspeaker and lower distortion of sound. The loudspeaker's cone simply does not need to be displaced so much from rest position to produce the same volume as conventional speaker. Less displacement means less distortion of sound (and lower requirements concerning the amplifier), which can be demonstrated by the fact that good horns can produce total harmonic distortion 10 times lower than their conventional peers also considered good quality.
For quite some time horn loudspeakers were in retreat - they are big after all (especially if you want them to produce the whole spectrum of sound, including the bass, this way, as longer wave requires larger horn), which means their so-called WAF* (Wife Acceptance Factor) is rather low. Recently, however, they are coming back and are highly valued by many audiofiles, as the limitations of the smaller conventional loudspeakers became obvious. Also, more and more people are beginning to realize that the main culprit of poor sound quality is not the CD (turntable) or amplifier, but the loudspeakers.
*However, WAF can always be worked on, as can be seen - arguably - below. The real challenge is to match great sound with great visual design.
![enter image description here](https://i.stack.imgur.com/Yh6FP.jpg)
Pnoe Horns by Arcadian Audio
![enter image description here](https://i.stack.imgur.com/N0nnh.jpg)
Klipsch Cornwall (bass unit is direct radiating, and not horn unfortunately)
Best Answer
There are a few different things going on here: