Saturday, 16 July 2011

Snippet - Play Sound (HTML5 Audio)

Very simple set up and function:
var boingSound = new Audio("http://slashgame.net/boing.wav");
function playSound() {
 boingSound.currentTime = 0;
 boingSound.play();
}


Example usage: ---CLICK HERE---

Taken from HTML5 Audio Quick Tip