What's the best place to keep game sounds?

So my question is this: What’s the best place to store game sounds, like music, to be played later by both client and server scripts?

I originally thought the best place to keep them was ReplicatedStorage, as it replicates to both server and client.
However, I later discovered sounds played from there by the server don’t actually play.
Same thing with SoundService.

So is Workspace really the best place to keep sounds like music and such?
Where do you guys keep/think is the best place to keep them?

8 Likes

If you want a part to play a sound from it, put it under the said part.

If you want it to play for everyone, put it in Soundscape and run Play() on it from a Script.

The answer is, it really depends on how you want to use the Sounds.

2 Likes

This would mostly be for sounds that need to play for everyone. (Music, etc.)
That said, what’s Soundscape?

Sounds parented to an Instance or attachment will play in 3D and any sounds parented to the Workspace will play as 2D sounds.

Soundscape is a service listed just like Players, Workspace, etc., you’ll find it in the browser.

Additionally, you can also get it in a script doing this:

local Soundscape = game:GetService("SoundService")

Ah, you mean SoundService.
This works for local scripts, but server scripts can’t play sounds from here.
Wherever I keep them, they will preferably need to be playable by both client and server scripts.

Are you putting Scripts under the Soundscape? Because then they won’t work.

Try putting a Script in ServerScriptService and try playing a sound from there.

Not sure, but replicated storage let’s both client and the server access it’s descendants, so that might be what you’re looking for.

I thought so too, but it has the same problem as SoundService.
Local scripts can play from it, but server scripts can’t.

1 Like

Huh? You’re correct. I’ve never noticed that before. Just tried it.

Well, what you could do is make a RemoteEvent under ReplicatedStorage and fire it for all clients to play a sound you want.

1 Like

I just have a guess, maybe it does have a position or something, is there a way to disable the range?
But as he said, you can just fire a remote event.

Yeah, I might do that, or put the sounds in Workspace, as it appears to be the only place client and server can both play from.

Keeping sound in Workspace though just seems, odd.

2 Likes

Good guess, but if it did have a position it would have to play form the center of the world (0,0,0), which it doesn’t.

Besides that though, wouldn’t it do the same on the client too if that where the case?
The fact this doesn’t work from SoundService is already weird to me.

1 Like

That’s honestly quite odd, I tried to play the sound from a server script once the player joined and it worked, but when I just used a wait() before that it didn’t.
Edit: I tried to set it to inf, it didn’t work.
image
Edit 2: I can’t understand this, it sometimes does work and sometimes doesn’t.

1 Like

Peronsally i would keep them in Workspace, and sometimes i have seen there is a ‘Sound’ area within the ‘game’ created on play and maybe you can move them to there using a script or something (or put them there if its accessible via roblox studio itself.)

I’ve decided to have them in Workspace under a GameSounds folder, as Workspace seems to be the only place server and client can both play from.

Thank you all for your input and suggestions.

3 Likes

FYI: Sounds consume quite a bit of memory. Unless you immediately need them all at the same time I recommend using one Sound Instance and change it’s SoundId when needbe.

14 Likes

Really?
That’s very interesting, I’ll keep it in mind. Thanks.

1 Like

I know this was 11 months ago. Anyways, SoundScape is what SoundService used to be until they changed it.

Soundscape contained the original sounds like the Victory sound until it was named “SoundService”. They removed the old sounds. And now, soundService is made to put sounds in to.