Since I am a bit ignorant when it comes to the sound object, I thought I should make a post about what I want to achieve, and ask how best to go about it.
I have a large world, and I want to have many different sounds playing, at specific locations. Fireplaces will have a crackling burning sound, waves crashing by the shores, birds or monkeys in the jungle trees, wind when on top of mountains, dripping in caves and the splash of waterfalls, just to name a few.
I do not want to have all of these sounds force loaded into memory on the client.
So my thought was to have the client only load and play a sound when you are near it, however this brings up a question. How does Roblox handle the memory of sound loading on clients.
If I have a sever sound object, and it replicates, will it always be in client memory? What if the server sound object is destroyed? Will that remove it form client memeory, if there are no other active references to that sound file? What if a sound id is changed, will the previous one be unloaded from memory?
I could not find anything answering these questions, so I created a system where the sound object is only created on the client, when a player is near it, and is destroyed when out of range, however with this I loose any 3D sound effects.
So should I do the same thing, but on the server end? Should I create and destroy sound objects as players get near them? Although if Player A is in the cave at one side of the map, and player B is at the beach on the other side of the map, would both clients have cave and beach sound loaded in memory? or would only the client that is capable of hearing the sound (emmittersize, and maxrange) actually get the sound data? And when destroying sound objects for one player (from server) clear the memory for that sound from its client?
How does the client know when to remove sounds from its memeory, and is it already very managed, or are there things a developer can do to affect this?
I know its a lot to read and a lot of questions, but I thank you for the time to look this over and any advice or knowledge you have is appreciated. Thank you.