You will need JavaScript for this. Remove the autoplay attribute:
<audio id="my_audio" src="bg.mp3" loop="loop"></audio>
and add the script as follows:
window.onload = function() { document.getElementById("my_audio").play(); }
Or if you use jQuery:
$(document).ready(function() { $("#my_audio").get(0).play(); });
source share