Best way to do multitrack playback.

Hi Aghcon,

if you want to load multiple tracks as buffers, the tracks become big floating point number arrays like [1.1123123;0.983921173,0.1112312] but in millions. Now imagine the RAM to handle all those million numbers buffers. 44100 sample rate per second 3 minute track 7.938.000 numbers per track times 10 your RAM needs to handle 100 million numbers or more simoultaneously. So you have to write a function to chunk the songs in the desired format and freeing up not needed space. So buffering only the part of the song where the cursor is at the moment could be a solution. Or only buffering the songs that are played at the moment. YOu can't load all of them at the beginning if you are using audio buffer and decode audio data. One solution could be to use audio tags with mp3 files. This shouldn't be as demanding as the audio buffers. The buffers are meant to be extremely fast, so they are big in size which causes performance issues. If you are using songs like you describe you should use the audio tags if you can. You can control audio tags as well. What do you mean with control the timing? Perhaps you give an example where you have problems in control. In audio tags you can jump to a specific time and play. This is all you need. If you don't want to use effects or gain nodes or all the other modular synth web audio api christmas tree, then you should be fine with audio tags.

If you want to talk further you can contact me as well on [email protected]

PS: The idea is really cool ;-)

Cheers Kilian

/r/webaudio Thread