Audio buffering or free up RAM for better audio performance?

Hi

i found this old topic from 2016 about audio streaming/ buffering Realtime audio visualizer (for projection mappers) - #3 by dave
is there such a function around now ?

Because I came across this app from three.js that seems to split audio in smaller pieces : three.js examples

I’m working on this project which works fine on my laptop, but quickly crashes and begins to stutter on most mobile devices. I think this is because it loads clips and quickly uses way too much RAM. there are 6 entities that contain scripts that loads different tracks and play them in positional audio. The idea of the project is to be able to add way more audio clips. It won’t get lighter. And I try to do without preloading all audio files in order to have the site loading fast.

My project: PlayCanvas 3D HTML5 Game Engine
See escpecially the script “clipplayer.js”, which also uses fisher yates shuffle to randomly pick clips!

Another alternative might be to free up memory on the go. I think currently the tracks load and play and then stay in memory. Is there a way to destroy themselves and free up memory after being played? I found this thread which asks a similar question.

Does anyone know how that could work? Am I on the right track?

I’m an artist, not a coder at all, so I’m super happy if there is anyone who’s interested in this problem to help make it work
:)))

Best
A

Have you tried unloading the audio assets you don’t use/no longer use? https://developer.playcanvas.com/api/pc.Asset.html#unload