Music Loop

I want to loop a sound/music until I set it not to through a function. I thought about using a scoreboard dummy and when the score is 1 it plays and when the score is 0 but how do I get it to loop without playing the song multiple times, and if I use a recursive function /stopsound doesn't work because the function still runs after you use /stopsound so even though the music stops after the function resets it plays again. Anyone know how I could go about this for reference not that it matters the sound/music I want to play is called tsf:music.glidermusic2 and it lasts for 140 seconds also I want it played through the records channel at max volume but min volume set to 1.

Continue to help post