Implementing multi-track functionality. Tutorials/examples?

Hello, so for any future inquiries, I have borrowed extensively from asi2015’s solution here: https://forum.juce.com/t/how-best-to-read-multi-mono-wave-files-into-a-single-audio-source/29641/13 . One of the major ways that I have adapted the code was using a HashMap to contain the references to the files as they are chosen instead of std::vector, delegating an index variable as the relative key which is passed down as an integer through capture on the “onClick” lambda function (this is another fun point, using [this, index] to capture).
I am only now experiencing the strange side-effect of the player crashing when there is only 1 file referenced in the HashMap, but other wise everything works well. The offending issue seems to have something to do with the getUnchecked() function in the getNextAudioBlock override.
I am sure there is a better way to do this, and hopefully it will become apparent when I go back to refine this application.

1 Like