Maybe you'd have to get a hook with some platform specific OS API that tells you when sound is playing (does this even exist though)? You could then match this to user interactions within the browser - did the user click inside my browser window when the event started? Then it's probably happening within that tab and I'm gonna show him that animation. False positives wouldn't be very harmful here, so you could let that slip.
My company has done that for multiple applications: http://www.nektra.com/products/audio-recorder-api/
Remember that on Google Chrome there is a separation of processes so you can differentiate what tab iis related to the sound.
For instance, if it's on the extreme side of the right monitor, play a sound in the right speaker.
Unfortunately, it doesn't work that way. While Chrome can run each tab in its own process, all Flash gets run through a single Flash process.
But with the new code they at the very least have it working with Flash. You can try it out right now by downloading a canary build and going to a Flash site (such as homestarrunner.com.)
The reason it works now while it didn't before is that they are passing extra information between Chrome and Flash so that Chrome can keep track of which Flash instances are making sound.
Edit: Thanks justinschuh for being more specific as to how this communication happens.
and that's why this should be a browser feature and not an extension.
The extension may live on if there are features that people want but that Google decides do not need to be a part of the browser.