Well you asked if it was possible, so I said it is.
You can use Port's global music which can also use individual music on clients too. Then you can use search containers of player object types and see if the main player can be damaged by the players nearby. If so, play some battle music, otherwise calm music.
I'm just giving an idea for how the code can work, hopefully it helps