Saving resources on sounds? (performance wise)

After reading the source I still have two questions, I have a few sounds that I only use once in the game, is the proper way to unload them from memory to .dispose() them? I couldn’t find a unload function.

Also, what’s the best way to handle loading in sounds? Say my game has two levels, do I load them on demand (When transitioning to the second level) or am I fine with loading them new BABYLON.Sound() at the start of the game and just call .Play() on them?

1 Like

dispose() would be perfect to get your resources back and I usually load them first and only call play() once I need them to prevent network latency issues.

1 Like