Drum Machine: test won't pass but App seems fine

Hello everyone,
I’ve been working on the Drum Machine and when I test it it seems fine, but the test won’t pass tests 5 and 6 and I can’t find why.
can anyone check where my mistakes may be?

Here’s my pen: https://codepen.io/Makusu-dev/pen/emYGxYp

Only strange behavior is that the last drumPad doesn’t allways sound for some reason but I cannot find why either, nothing in the console and other parts of code in the same loop seem to be fin.

You have to call .play() on the audio elements and not use the Audio constructor. So in your handlers, you would call .play() directly on the sound element.

1 Like

Oh right! I think I get it. I had built the app a certain way before noticing I needed an audio element for each drumpad (Which I would change on button click), I have changed that but forgot to change the way I play the audio. I should be able to fix it thanks. I’ll be back shortly to confirm it.

And you were right! Thanks a lot!