I am making a game with HTML5 and JavaScript.
How could I play game audio via JavaScript?
if you want to play your audio whenever the page is opened then do like this.
and call this playMusic() whenever you need in your game code.