Does ReplicatedStorage preload sounds/assets?

A common issue that I have is that sounds don’t load quickly enough on the client when they are played. So I have been wondering, does putting Sound Instances in ReplicatedStorage “preload” them? And if this is the case, do all Sound Instances with the same rbxassetid:// load aswell? I created a sound module for my game with a function that plays a sound and automatically destroys it when it has finished, but the sounds just don’t load on time. Thank you in advance!

From what I understand about PreloadAsync, it’s able to take an Array of Instances (Or content related items being SoundID’s) and loads everything inside that array until everything on the client is loaded (The code also yields as well)

When the loading is complete, it will continue throughout it’s code

I’ve heard of this (and planning to use it in the future) but I was wondering if ReplicatedStorage did this too. Thanks for the detailed response.

1 Like

I mean, yeah as long as the client is able to access whatever it wants to load then you could pretty much use the function to load what you need

local ContentProvider = game:GetService("ContentProvider")
 
-- Create some objects to be preloaded
local sound = Instance.new("Sound")
sound.SoundId = "rbxassetid://1838058421"
local decal = Instance.new("Decal")
decal.Texture = "rbxassetid://5447528495"
 
-- A table of various assets to preload (Instances or content)
local assets = {
	decal,
	sound,
	"rbxassetid://5173222739",
	"rbxthumb://type=Avatar&w=100&h=100&id=269323"
}
 
-- For demonstration, pre-load 50 random user's avatar thumbnails
for i = 1, 50 do
	table.insert(assets, "rbxthumb://type=Avatar&w=100&h=100&id=" .. math.random(1,1000000))
end
 
-- Preload the content and time it
local startTime = os.clock()
ContentProvider:PreloadAsync(assets)
local deltaTime = os.clock() - startTime
print(("Preloading complete, took %.2f seconds"):format(deltaTime))