[SOLVED] Dynamically load music from a directory using javascript

I’m making a rhythm game, and I want to be able to load music files from a specific directory for custom levels. I know there isn’t an easy way to do this, but I’m thinking that it might be possible using javascript. Any help would be much appreciated.

Thank you!

Edit: I managed to accomplish this by making use of the Audio() class. I created the dictionary gdjs.customMusic to keep track of the music that’s currently being played and their respective channels. I used stuff like Audio.currentTime() to get a music channels offset etc.

I hope this helps someone!

1 Like

Hi! I’m also making a rhythm game, and would like to know how you managed to add external audio files to the resources at runtime. A screenshot of your code would help a lot.