Skip to content Skip to sidebar Skip to footer

HTML5 JS Play Same Sound Multiple Times At The Same Time

I'm create a very basic HTML5 game and I've hit a little wall, basically I have an array, this array is populated with one sound file (it is an array so I can assign more sounds if

Solution 1:

In order to play multiple instances of the sound at the same time, you will need to create a new copy of that Audio element. One way to do this is to use the .cloneNode() method and play the cloned audio every time the spacebar is pressed.

this.Sounds["L_Explosion1"].cloneNode(true).play();

Post a Comment for "HTML5 JS Play Same Sound Multiple Times At The Same Time"