Loading Assets from Memory Resources

Hi. How should I load assets from memory buffers instead of URLs? Pardon this probably naive question, but I’m new to JS as well as Babylonjs.

Use case: Files are present in memory (ArrayBuffer) either as a result of procedural computation (mostly audio, synth) or mapped from a tar container fetched by XHR.

@bghgary has an amazing sample for it

This should help Help needed for loading gltf with blob or arraybuffer

@PirateJC I guess we definitely need smthg in the doc for it :slight_smile:

1 Like

Hello and welcome!

Here are the docs: Audio | Babylon.js Documentation
Example - https://playground.babylonjs.com/#PCY1J#2

1 Like

URL.createObjectURL … what a handy solution, quite unintuitive from a non-webdev perspective. no wonder my searches didn’t turn anything up :slight_smile: thanks a lot!

1 Like

Sorry for the delay,

New doc added to highlight how to do this.

Thanks to @bghgary for the help in figuring out the right thing to say.

4 Likes