You can create some Audio objects in script with your original ids and pass them to the function.
ah ok to preload sounds
local SoundObject = Workspace.SoundObject
SoundObject.SoundId = "URL-like string"
ContentProvider:PreloadAsync({SoundObject})
That’s how it’s done now I think
Isn’t that kinda counter productive tho? I don’t want to create excessive audio instances until I need them
Out of curiosity, how was this being abused? Were users preloading places or something?
Please tell me this is a warning and not saying it is about to go live. I need to redo a lot of my loading screen in Ultimate Boxing or I will get a lot of complaints of long loading times.
Its already live, got errors in my game so I had to turn of preloading by soundId
It’s not really related to this function. We added type check to asset requests. So by getting asset ids from instances, client will know what type of asset it is.
Fix it! Easy fix, so no need to fret :P
function preloadSoundsById(soundIdList)
local soundInstances = {}
for _,soundId in next,soundIdList do
local soundInstance = Instance.new("Sound")
soundInstance.SoundId = "rbxassetid://"..soundId
table.insert(soundInstances, soundInstance)
end
game:GetService("AssetService"):PreloadAsync(soundInstances)
end
Great… load times for Ultimate Boxing seem to be much higher now for the skippable part of the loading screen.
I would prefer to mod my loading screen for the update tomorrow rather than hot fix it like that for tonight.
This update is awesome and made more universal for many asset types.
But please tell us before you make these changes;
I’m getting complaints about music not working in my game as I’m scampering to fix it up
Sorry for that. I’ve turned the flag which will cause errors off. PreloadAsync with instances will still work. You can take your time.
The base idea is that you will likely save objects with preload ids in ReplicatedStorage or somewhere, you can just preload these objects instead of getting ids from them. I’m not sure your use case. Do you use one Audio object and change its ids dynamicly?
How long do we have before this becomes re-enabled?
When the player shoots their gun or reloads it makes a sound object that then plays. Making a bunch of sound objects for each gun sound is just tedious and is just easier with stored sound ids.
Having to hack around the sound object and spam-clone multiple instances is more a problem with sounds than it is preloading. Would maybe be nice to solve that issue with sounds instead so we don’t have this hacky workaround to begin with.
What I do currently is create the template sound in model and then clone it whenever it needs to be played, which should be a reasonable integration with preloading until sounds are improved.
Cheers, something that I’ve been waiting for a while for.
Excellent feature!
Given that this change isn’t backwards-compatible, I think the reasoning behind it deserves more of an explanation.
This is a problem. I have a configuration module in RS Minigames that stores all sound and image asset IDs used in the game. This module is read by the loading screen client to preload all sound and image assets, so there is no loading delay while playing the game. I have at least 60 assets that are preloaded. With this change, I now have to hackishly create a sound object, set its ID, and load that sound asset, then destroy the sound object. This is not only ‘hackish’, but it’s bound to cause lag, which can interfere with the loading screen UI animations.
To a degree, yes. I have two clients in the game - The lobby client and the Minigame client. They both use one sound object, dynamically changing its ID and ‘fading’ the volume for music changes.
Why are images able to be loaded as IDs still, but not sounds?
This update is nice, but it would be even better if we could keep the ability to load sound and image assets as IDs.
Why does it assume just images and not others anymore? I use PreloadAsync more so for yielding audio as to keep in sync with in-game events.