Changing Audio when camera changed?

This question is not a code related one, more of a can this been done and where do I start.

I have a couple of cameras within my scene that can be switched to when ever the user feels like it and obviously I have different sounds that are closer to different cameras.

There is a object in between certain cameras and sounds (for instance there is camera inside of a house and the another Camera on the outside)

My question is how would I be able to switch from one camera to the other and cause the sound located within the house (or outside) to be muffled depending on which camera I have chosen. They are still playing its just it has been muffled.

and also if the object like the house is destroyed how do i then unmuffle the sound outside in runtime?

Any help will be appreicated!

In the script that plays the sound from that object, before playing the sound, make a raycast to the active camera… If that raycast hits the house’s wall (or whatever barrier that would muffle the sound), then lower the volume before playing it. If it does not hit anything that causes muffling, just play the sound normally