All whistles have a mouthpiece where the air is forced into a cavity or hollow confined space. The air stream is split by a bevel, and partly whirls around the cavity before exiting though an opening (or sound hole) which is usually small in proportion to the size of the cavity. The size of the whistle cavity and the volume of air contained in the whistle determine the pitch or frequency of the sound produced.
The whistle construction and the design of the mouthpiece also have a dramatic effect on sound. A whistle made out of thick metal will produce a brighter sound compared to the more resonant mellow sound if thinner metal is used. Modern whistles are produce using different types of plastic, which increases the tones and sounds now available. The design of the mouthpiece can also dramatically alter the sound. Even a few thousandths of an inch difference in the airway, angle of the blade, size or width of the entry hole, can make a drastic difference as far as volume, tone, chiff (breathiness or solidness of the sound) are concerned.
In a pea whistle, the air stream enters through the mouthpiece as shown (1). It hits the bevel (2), and splits outwards into the air, and inwards filling the air chamber (3) until the air pressure inside the chamber is so great, it pops out of the sound hole, making room in the chamber for the whole process to start over again. The pea (4) gets forced around and around and interrupts the flow of air and changes the rate of air packing and unpacking inside the air chamber. This creates the sound of the whistle warble.
The air inside a whistle chamber packs and unpacks 263 times every second to make the note middle-C. The faster the packing and unpacking is, the higher- pitched the sound the whistle creates.