I'm building a game in which a wav file plays on click - in this case it's a gun sound "bang".
The problem is if I rapid click, it won't play the sound once for each click - it's as if the clicks are ignored while the sound is playing, and once the sound is finished, it starts listening for clicks again. The delay seems to be about one second long, so you figure if someone clicks 4 or 5 times per second, I want 5 bangs, not 1.
Here's my HTML:
<audio id="gun_sound" preload>
<source src="http://www.seancannon.com/_test/audio/gun_bang.wav" />
</audio>
Here's my JS:
$('#' + CANVAS_ID).bind(_click, function() {
document.getElementById('gun_sound').play();
adj_game_data(GAME_DATA_AMMO_ID, -1);
check_ammo();
});
Ideas?