So, we’ve an event this weekend and I need to play an audio file during the loading screen.
Now, I’ve tried countless scripts from google but nothing seems to let an audio file play in IE9 (I believe this is what gmod uses for loading? I might be wrong).
We have an unfinished loading screen for it, needs some work. But I cannot get the background audio to play in IE at all, can’t get it playing inside Garrysmod either. Is audio blocked? Although again probably an IE issue.
Last code I tried was this, still didn’t work.
<audio id="background_audio" autoplay="autoplay"> <source src="static/audio/clip.ogg" type="audio/ogg" /> <source src="static/audio/clip.mp3" type="audio/mpeg" /> </audio> <![if (!IE)|(gte IE 9)]> <a href="#" onclick="document.getElementById('background_audio').muted = true; return false">mute sound</a> <![endif]> <!--[if lt IE 9]> <bgsound id="background_snd" src="static/audio/clip.mp3" autostart="true" loop="1"> <a href="#" onclick="document.all['background_snd'].src=''; return false">mute sound</a> <![endif]-->