Internet Explorer HTML5 (Impact) M4A problem solved

Internet Explorer HTML5 (Impact) M4A problem solved

//I solved the 'SCRIPT5022: Failed to load resource' problem with M4A files in Internet Explorer

//Published —Page updated8 years ago

At the moment, a combination of OGG/Vorbis and M4A (MPEG4 AAC) ist the best way to add sound and music in a HTML5 game. Impact provides an easy way to do exactly this: Impact Sound docs.

ig.Sound.use = [ ig.Sound.FORMAT.OGG, ig.Sound.FORMAT.M4A ];

Unfortunately, Internet Explorer does not load the game:

SCRIPT5022: Failed to load resource: media/laser.ogg

This Ludum Dare I realized, that it actually worked fine on my local machine. So I started searching and finally landed here: MSDN audio element (Internet Explorer). There are some mime type setting infos in the remarks section. Since I tried basically everything else, I added a .htaccess to the game folder:

AddType audio/mp4 .m4a

... and it worked!