- Home /
Best way to handle 100+ sound files
Hi,
I have an audio controller that occasionally plays a random audio clip, out of a list of about 150 clips. Right now, these clips are simply attached to this object in its public AudioClip[]
array. They are all short "compressed in memory" audio files.
As I understand, this setup means they are all loaded into memory on level load.
I was wondering if perhaps a better way to deal with it would be to use Resources.Load()
instead, or perhaps there is a better way to make it so each clip is loaded as needed, and its memory is freed when done playing.
Thanks for any tips.
EDIT: I am also considering using StreamFromDisc, as I will usually have no more than 2 of these playing, but still I am suspecting it might cause noticeable performance hiccups.
Your answer
![](https://koobas.hobune.stream/wayback/20220613134352im_/https://answers.unity.com/themes/thub/images/avi.jpg)