abcjs
abcjs copied to clipboard
Switched from XMLHttpRequest to fetch with try/catch
In my testing with large number of sample reads, using fetch() instead of XMLHttpRequest appears to be faster overall.
Not sure if it's related to better use of multithreading or perhaps the sample decoding happening async, but with combinations of both the standard and my custom soundfonts, this seems faster to load all the samples.
Tested on my Mac with Safari, Chrome, Firefox, as well as in mobile Safari on my iPad Pro and iPhone 14 Pro Max.