A good description of whistle "physics" is at wiki Police whistle.
I linked to the section on police whistles but the physics and math discussions above it I suppose would be interesting if I could stay awake. I suspect that when you add a pea what you are doing is adding an object that moves around and disrupts the flow which causes a warble rather than allowing a steady tone. Remove the pea and you get a steady tone. Freeze the pea and you have a partial obstruction in the chamber which the air flows around -- it's a different tone, but it's still a whistle. in my totally physics challenged opinion wink