Flash interace with sound (don't know how to name this)

Ok, This is really important, I have a website that depends solely on this, and need to know how to do this (or if it’s even possible!)

You know those sound players (like windows media player) that produce waves and stuff according to the beat of the sound its playing. I swear I have seen flash music players do this too, perhaps I am wrong, but how do you do that? Anyone have any example code or tutorial around? I don’t need anything complex, just a way for flash to judge the sound it’s playing and perhaps store the relative loudness (to judge beats and such) in a variable… from there it’s easy.

Please help! I’m in quite a pickle.