Hi , I need help with my drum machine project, as I got stuck at a place where I want to play audio files in jquery.
My codepen is:
Hi , I need help with my drum machine project, as I got stuck at a place where I want to play audio files in jquery.
My codepen is:
You can’t use the Audio constructor. Because of how the tests work you need to use audio elements to the page and call the play method on the elements.
You have page links for the audio, they have to be actual audio files (e.g. .mp3, .wav). The example project has some links you can use if you need them.
The code you have now just won’t work. I would suggest you check out JavaScript30 from Wes Bos. One of the projects is even a drum machine so that should get you going in the right direction. Another option would be to take some more time to better learn frameworks like React (or Vue, Svelte) and use the projects to practice the framework.
BTW, you should really put the JS in the JS code box on Codepen and not have it in the HTML.
Thanks, Lasjorg for the reply will try to do this project in React:)
This topic was automatically closed 182 days after the last reply. New replies are no longer allowed.