AudioPlayer.playAudio=function(v)local Y=SoundService:FindFirstChild(v)if not Y then warn("\067\111\117\108\100 \110\111\116 \102\105\110\100 \097\117\100\105\111 \097\115\115\101\116\058 "..v)return end if not Y.IsLoaded then Y.Loaded:Wait()end Y.Volume=0 Y.Looped=true local y=TweenService:Create(Y,TweenInfo.new(10),{Volume=.5})Y:Play()y:Play()y.Completed:Connect(function(v)if v==Enum.PlaybackState.Completed then y:Destroy()end end)end return AudioPlayer
-- Function to play an audio asset
AudioPlayer.playAudio = function(assetName)
	local audio = SoundService:FindFirstChild(assetName)
	if not audio then
		warn("Could not find audio asset: " .. assetName)
		return
	end
	if not audio.IsLoaded then
		audio.Loaded:Wait()
	end

	-- Setup a tween so the track starts quiet and then fades in to a normal volume
	audio.Volume = 0
	audio.Looped = true

	local fadeTween = TweenService:Create(audio, TweenInfo.new(10), { Volume = 0.5 })

	audio:Play()

	-- Fade in the audio track
	fadeTween:Play()
	fadeTween.Completed:Connect(function(State)
		if State == Enum.PlaybackState.Completed then
			fadeTween:Destroy()
		end
	end)
end

return AudioPlayer
