3
votes

I have three mp3 audio files that play fine in all browsers but play for only 1.x seconds in IE9 unless I change "controls" to "autoplay" in which case it plays just fine.

I was then sent the original, unedited file in .wav format. I encoded it myself to mp3 but have the same problem.

However, if I create my own mp3 audio file and insert it into the same markup, it works in all browsers, including IE9 with the "controls" attribute.

I can only think there is something about the settings in the original audio file that would cause the issue but don't have a clue what that could be.

Here is the test markup:

<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<title></title> 
</head>
<body>
<audio src="poem.mp3" controls >
</body>
</html>

EDIT:

I put three audio files on the page. Sometimes one or two will play all the way through while the third won't play at all. Other times, two will play for a second but the third does nothing.

4
An interesting thing is that I edited the file, reloaded, and it worked...once. Clearing cache and reloading the page and it doesn't play.Rob

4 Answers

3
votes

In case anyone is still dealing with this issue, I use the standard <audio> markup for mp3.

<audio controls="controls" preload="auto">
<source src="http://www.davehullthehullabalooer.com/help(5).mp4" type="audio/mp4"/>
<source src="http://www.davehullthehullabalooer.com/help.ogv" type="audio/ogv"/>
<source src="http://www.davehullthehullabalooer.com/help.webm" type="audio/webm"/>
<source src="http://davehullthehullabalooer.com/add-for-beatles-page-188.mp3" type="audio/mp3"/>
</audio>

In IE9: Internet options > Advanced Tab > Multimedia, I select "Play sounds in webpage"

All good!

2
votes

EDIT: My fix didn't work. It still fails in IE9 but everything works still in every other browser.

An answer to my own question that solves the problem, at least, but I have not found out why.

I don't know why some mp3 files play just fine in IE9 but others, that also work well in any modern browser, won't play in IE9 using the markup I show above. I made audio play by adding the audio attribute preload="auto" and all is fine now in IE9.

Modern browsers do not need this. Why IE9 does, I do not know yet.

2
votes

I was having trouble with audio controls showing on IE9 and found that IE9 struggles with the preload attribute. I didn't want the browser to preload all the files by setting them all to 'auto' but found that setting the preload setting to 'metadata' instead of 'none' did the trick. Could be an alternative solution. http://helephant.com/2011/12/29/the-html5-audio-tag/ : "Metadata suggest that the browser just download enough of the file to find out things like dimensions, running length and size."

0
votes

Ran into the same problem, audio files would only play first second when preload is set to metadata on IE9. Turns out that my API was gzip compressing all responses and IE9 was having trouble dealing with it. After removing gzip/deflate compression from audio and video files, IE9 was fine with it.