Can't preload sounds with just asset ID string

You can preload images by pointing to a Decal object or asset string like "rbxassetid://272172789",

You can only preload sounds by pointing to a Sound object. This is annoying, especially when I have a list of sounds/songs I want to preload from ReplicatedFirst, so playing one doesn’t have a delay at the start

local ContentProvider = game:GetService("ContentProvider")
local assets = {
	"rbxassetid://272172789", --preload xbox controller spritesheet
	"http://www.roblox.com/asset/?id=111124523", --preload sound (doesn't work)
	script:WaitForChild('Sound1'), --preload sound (works)
}
ContentProvider:PreloadAsync(assets)

Output:

ContentProvider:PreloadAsync() failed for http://www.roblox.com/asset/?id=111124523

I believe you can only preload objects and not strings. :thinking:

You can preload strings if they’re images

(I don’t want to put references to my objects in my separate preload script; the objects are in multiple places)

Seriously.

An array of Instances to be preloaded.

Instances mean objects, not values. This is indeed confusing, but you have to preload by creating instances and insert IDs which then you’ll insert into the table of preloading.

This is not a bug, the behavior was changed some time ago and preloading with strings is probably only kept for backwards compatibility reasons. You can read this for more info: ContentProvider:PreloadAsync and Preload update

Thanks, created a Feature Request Ability to preload sounds by assetid

1 Like

Not a bug