Drum Machine #5

Guys, please. I can’t understand how to play audio when I press the button. I looked for so many hours but I got tired.

CodePen

You don’t have any code for handling playing, at all. If you add some code we can help guide you. If you search for Drum Machine on the forum there are tons of threads to learn from.

For the mouse button click it’s fairly simple.

For the keyboard press, you can attach an event listener to the document.

1 Like