why initial delay on click response

I made a drum machine based on a tutorial I saw and upon initial page load, the first button clicked has a significant (@ 2 seconds) delay before sound plays. After that, there is not major delay. Since my version is different from the tutorial version, I tried loading the completed version as shown in the tutorial and it happens on that one too. On mobile, there is a slight delay on every click. Is there something I can do to negate the pause?

live site link: https://princecorwin.github.io/AMALFI-Motif/

Github repository: https://github.com/PrinceCorwin/AMALFI-Motif

screenshot of app

Read more here: https://stackoverflow.com/questions/66278108/why-initial-delay-on-click-response

Content Attribution

This content was originally published by TribeOfOne at Recent Questions - Stack Overflow, and is syndicated here via their RSS feed. You can read the original post over there.

%d bloggers like this: