Music plays when enemy ai see's the player

I created an AI based off of this video

and I’m just wondering how I can make it so that music plays when the AI sees the player

One way i did it is by having a sphere collision on my player, set the collision to like 3000 and fade in music when he comes in the collision and fades out when he leaves collision

You can do it using pawn sensing. Or by line tracing to the player from enemy’s eye. If line trace hits the player and if the trace angle is between -45 to 45 degrees from his forward vector (implementing vision cone) turn on the music. Otherwise, turn it off.