01 | ~ local SoundService = game:GetService( "SoundService" ) |
02 | local ReplicatedStorage = game:GetService( "ReplicatedStorage" ) |
03 | local GameMusic = require(ReplicatedStorage:WaitForChild( "GameMusic" )) |
04 |
05 | local function MusicPlay() |
06 | for i,music in pairs (GameMusic) do |
07 |
08 | local sound = Instance.new( "Sound" ) |
09 | sound.SoundId = music |
10 | sound.Parent = SoundService:FindFirstChild( "GameTrack" ) |
11 | local audio = SoundService:FindFirstChild(sound) |
12 |
13 | if not audio.IsLoaded then |
14 |
15 | audio.Loaded:Wait() |
the output says : Failed to load sound 1500963599: Unable to download sound data
Make sure your sound data is is associated with rbx asset ID.
All sounds MUST have 'rbxassetid://' before the actual sound ID.
For example:
1 | local Id = "123456789" |
2 |
3 | game.Workspace.Sound.SoundId = Id --This would cause an error because it isn't registered with rbxassetid:// |
4 |
5 | game.Workspace.Sound.SoundId = "rbxassetid://" .. Id --Wont cause an error because is registered with rbxassetid:// |
Keep in mind, this is only when a script is setting the Id. In studio you can just put in the number and it will automatically register it for you. This error will also happen when a sound doesn't exist, or was moderated.