Create sounds for all users and be able to stop them

I’m trying to make a TTT end round music addon, which i have working and im currently using this to play my sound


local LoadedSounds
local sound
if CLIENT then
	LoadedSounds = {}
end
function EndRoundMusic:PlaySound( FileName )
	local filter

	if SERVER then
		filter = RecipientFilter()
		filter:AddAllPlayers()
	end
	if SERVER or !LoadedSounds[FileName] then
    sound = CreateSound( game.GetWorld(), FileName, filter )
		if sound then
			sound:SetSoundLevel( 0 )
			if CLIENT then
				LoadedSounds[FileName] = { sound, filter }
			end
		end
	else
		sound = LoadedSounds[FileName][1]
		filter = LoadedSounds[FileName][2]
	end
	if sound then
		if CLIENT then
			sound:Stop()
		end
		sound:Play()
	end
	return sound
end

function EndRoundMusic:StopSong()
  if sound then
    sound:Stop()
  end
end

My issue is that the sound stops before i get the chance to even run EndRoundMusic:StopSong(), pretty sure its because I’m creating the sound to the world and TTT resets the world at the beginning of the preparing stage. I didn’t see a way to stop a sound when surface.PlaySound() is done is there a way to make such a function? I know there is an addon out there for this but to my knowledge it plays the sound for the full length, I’m wanting it to cut off at the TTTBeginRound hook.

Try

sound.PlayFile

I see, the code I’m currently using can be ran both server and client but i guess ill just use network
strings for this like i originally planed. How would i go about shutting the sound off though?

[editline]11th September 2016[/editline]

I’m basically wanting it so the sound files don’t have to be a set time I want the music to shut off when the hook TTTBeginRound happens and start when TTTEndRound happens.

I really need a way for doing this because any current one doesn’t work correctly or how i want it to. There is no sound.Stop function so i need to basically create that but I wouldn’t know where to start with that.