Jump to content

Sound doesn't loop in Internet Explorer


mattbrand
 Share

Recommended Posts

  • 6 months later...
  • 1 month later...
On 8/10/2017 at 3:25 AM, samme said:

I spent a whole day wondering why my code doesn't work but this does. It turns out it wasn't my code, it was the mp3 - the 7 seconds mp3 in the sample works with my code too, but a 1 minute music mp3 doesn't :( I tried .ogg too without success.

Anyone else experience this?

Link to comment
Share on other sites

  • 3 months later...
12 hours ago, samme said:

@marcusfenix does examples/v2/audio/loop work in your IE?

It does work for me.... I guess it is a problem with my mp3 file just like @ozdy

Not sure if there is something to do with the encoding of the mp3 file. Any idea @samme?

 

Edit: Update

When I use the same sound from the Phaser example in my project, it does not loop. :(

Link to comment
Share on other sites

Yes I am using loopFull. However, I have observed a couple of things here:

  • Think loopFull uses the same play function with loop being set to true.
  • Just made sure that my mp3 is similar to the one the example. By that I mean, the mp3 encoding is Mono, at 96bps and 44100KHz.
  • This is a very IE specific issue. When I hosted the same game on another web host, the looping works and also, the looping events are fired. I compared the headers from both hosts and they are different. I am still investigating into this issue and will post an update once I have an answer.
Link to comment
Share on other sites

33 minutes ago, alex_h said:

IE doesn't support web audio, it has to use HTML tag audio playback instead, hence not looping.

https://caniuse.com/#feat=audio-api

That's right @alex_h However, this is not related to Web Audio or HTML Audio, because some sounds loop fine. So it is related to how it is encoded and the response header is what I think as of now.

Link to comment
Share on other sites

Oh yeah, I didn't see your post about different response headers from different hosts. Do you see the same effect on those two hosts if you use other audio formats, ie .ogg and .m4a? If not then maybe avoiding the mp3 format is a good way to work around the issue?

{Edit} ok I also just noticed Ozdy above says the same thing happened with .ogg too... doh!

Link to comment
Share on other sites

Ok I got it working!! IE needs to read the "Content-Length" in the header to trigger events like onLoop. My server being Apache, compresses the files being served using gzip. Disabling this through an .htaccess file in my sounds folder fixed this issue. You can do that by creating one and inserting

SetEnv no-gzip 1

This however will disable gzip for the whole folder so please use it accordingly. Hope this helps someone.

Link to comment
Share on other sites

 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...