Managing audio files

n my project I will have a lot of sound files.
Should I clean the buffer from these unused sounds?
If so, how can I do it?
I will be grateful for every hint.

1 Like

tons of really good docs on this…

thats where id look first : )

In addition we load our sound on delay (in a separate module lazy loaded):

var createSonicz = function( ){ //
    nx.sonic.track1=new BABYLON.Sound("bg1","./sonic/nxBoomCore2cc0.mp3",nx.scene,null,{loop:false,autoplay:true, volume:0.04});
    nx.sonic.blip2= new BABYLON.Sound("blipIn1","./sonic/nxBlip2b.mp3", nx.scene, null, { loop: false, autoplay: false });
    BABYLON.Engine.audioEngine.setGlobalVolume(0.8); //0.02 is on the quiet side.
    	nx.sonic.theme1= new BABYLON.Sound("theme1","./sonic/nxTheme1.ogg", nx.scene, null, { loop: true, autoplay: false });

We see sound is pretty heavy. we do not yet clean up unused sounds.

Probably better ways to delay sound (upcoming). We are light for PWA

1 Like

I was wondering this as well for particle systems.
I think it may be better to allocate early on what I need, and modify existing systems as I go.