Multitrack Love

Hi, I made this multitrack player of some famous songs so that you can re-discover them by muting some tracks :slight_smile:

I originally made it few years ago in Flash, and as I learn Phaser I tried to do this as a challenge

I made it with Phaser 3, on mobile it can crash the browser after playing many songs, I don’t know why… I clean the cache etc, any idea is good to take !


Cool! I liked it!

What do you mean you clean the caches? How do you do that?

Do you properly dispose any instances of media player related objects like media streams, media stream tracks, media player, audio nodes etc. in case you use them?

Thank you !

For the loading of the mp3 I use :

let mp3Load ="drums_mp3", 'drums.mp3');

For each track (voice, guitar etc, each time the same key name - I supposed it replace the old one- )
And then when you load a new song, I “clear the cache” like this :


//TAB_INSTR is an array containing the sound objects
TAB_INSTR.forEach((item, index) => {
    item = null;
}); (snd) {        
    snd = null;
}, homeScene);;

Getting into what does these Phaser functions do under the hood can give you ideas about what you should do about resource usage economy. Maybe you need to use another function, tweak some or implement a little custom functionality. Again I would suggest you look more for Web Audio and gotchas to use it efficiently.