it's possible play a music when you see a enemy(see int he screen)

Check the Raycast functions.
Cast a raycast every X ms from player to the enemy, if true play music.
Maybe check the distance like vegetamaker said, so it doesn’t play if he’s far in the distance.