multiple instances of one sound wave file?

when i read the manual , it seems to me there is no “instancing” of sound files.
eg. if multiple characters use the same gun sound file, i have to load the sound file multiple times, or at any moment there can be only one gun sound audible.
my concern is, if many copies of a large sound file are loaded, memory consumsion would be large?

If you load a sound file more than once, Panda will use a cached copy. So it will not use more memory.

Your response lacks detail needed to help you.

Right now it sounds more like you are guessing, with no actual data behind it.

Could you try again?

I think the question is clear: Will doing loader.loadSound(‘test.mp3’) (or loadSfx, or loadMusic) 3 times where ‘test.mp3’ is 1 MBytes cause 1x3 MBytes of memory to be used? The answer is no, it will get cached and take up 1 MByte memory. On top of that, if your audio file is too long, the whole file won’t be loaded in RAM at once, but chunks as it gets played. I think the latter can be changed in Config.prc and I don’t know if it only works for loadMusic() or all of audio loading functions.

Caching is basically Panda checking if the file is already in the list of loaded files and if yes, get its data which is already loaded instead of loading once more. To get rid of the file from the list in the cache, get rid of all the references to it or create a situation when Python’s “Garbage Collector” steps in.

loadModel() and similar functions also use the caching mechanism.
Instancing of models (meshes/nodepaths, not model files) is a different story.

This should be the case with every game engine.