New course! Every coder should learn Generative AI!
Try a free lesson+ 4
I think this is what you want.
https://stackoverflow.com/questions/9419263/playing-audio-with-javascript#18628124
Try to check other sources before going to the Q/A. You could also use the audio tag in the HTML course. Good luck on the project!