Music for games

Hello all!!

With music, whats the code to loop a .wav, say 5 times then stop? And stop if you exit the level?

I’m sure I could find in in a tutorial, just askin here too though…