How to use in pairs loop and content provider to load in music to game

I recently watched TheDevKing’s Sounds and Music tutorial and I wanted to try it for myself. I have a folder in ReplicatedStorage that has all of my sounds in it. I tried to make an in pairs loop to play all of the songs and then used the content provider to load all the songs in but then I had an error (below)

Unable to cast to Array 

My script is being shown below and I don’t know what is wrong with my script because I followed what TheDevKing did and somehow I still got this error. If anyone knows anything about this, please help me. It is very appreciated and thank you in advanced.

local Music = game.ReplicatedStorage.Music
local ContentProvider = game:GetService("ContentProvider")

while true do
	wait(1)
	for i, v in pairs(Music:GetChildren()) do
		ContentProvider:PreloadAsync(v)
		v:Play()
	end
end

Try this:

local Music = game.ReplicatedStorage.Music
local ContentProvider = game:GetService(“ContentProvider”)

while true do
wait(1)
ContentProvider:PreloadAsync(Music:GetChildren(), function()
for i, v in pairs(Music:GetChildren()) do
v:Play()
end
end)
end

It shows no errors but the music don’t play.

You aren’t using :PreloadAsync properly. PreloadAsync takes an array, not an instance. You also only have to load it one time.

local content = {}
local Music = game.ReplicatedStorage.Music
local ContentProvider = game:GetService("ContentProvider")

for i, v in pairs(Music:GetChildren()) do
	content[#content + 1] = v.SoundId
	v:Play()
end
ContentProvider:PreloadAsync(content)