Node.js examples for HTML:Audio
Plays a sound via HTML5 through Audio tags on the page
/**// w w w.j a va 2 s.c o m * Plays a sound via HTML5 through Audio tags on the page * * @require the id must be the id of an <audio> tag. * @param id the id of the element to play * @param loop the boolean flag to loop or not loop this sound */ startSound = function(id, loop) { soundHandle = document.getElementById(id); if(loop) soundHandle.setAttribute('loop', loop); soundHandle.play(); }