My first guess is this may not even be possible
Scenario:- Quite often I will be multitasking. On one monitor I may be watching a movie, or listening to music, whilst on another I might be surfing this forum, the web, or trying out a new application. Some website still insit on playing sound when you open them, which interupts what I want to listen too, the same with some older applications.
What I would like to be able to do is Whitelist applications or websites where I would like to here sound, and all the rest not hear a peep. Obviously this facility would be easily toggleable on/off.
Put simply I want to only hear what I want, not what others think I should hear.
One issue i can see is that the window/app i want to hear sound from, will likely be the one without focus.