Hi. I am trying to validate the Drum Machine test. All tests passed except for test #6 which tests that when a key is clicked the appropriate audio runs. Indeed, when I test manually, audios don’t run systematically, especially if the interval between 2 pad key clicks is short. Could you please help me on that? What is it due to and what should I try and do instead?
Here’s the codepen url: https://codepen.io/GStucki/pen/WbejQxR
Test #6 isn’t a click test, it is a key press test. You should have an event listener for keyboard inputs that play the audio.
As for playing the audio faster for the clicks/presses, you can reset the currentTime
on the audio element before playing it.
1 Like
Thanks a lot lasjorg. Your reply has been really helpful.
1 Like