5

I'm trying to make a simple audio test in html5 (Windows 7) and it works in Firefox and Chrome, but not in IE11. Can anyone help me, please? This is my simple HTML file:

<!DOCTYPE html>
<html>
    <head>
        <title>My Title</title>
    </head>

    <body>
        <audio controls>
            <source src="myAudioFile.mp3" type="audio/mp3"/>
        </audio>
    </body>
</html>

I have read all questions related, but my problem is not fixed. Also, I tryed to add this, but still no luck:

<meta http-equiv="X-UA-Compatible" content="IE=edge" />

I always get the "invalid source" message and I don't know what else can I do.

4 Answers 4

9

The problem is that IE11 makes you enable the setting "Play Sounds in Webpage" before any sounds will play. Which, in my opinion, is a willing and intentional breakage of HTML5 audio. I'm so pissed at MS for this. They constantly go against what they preach, and they wonder why nobody uses their shitty browser anymore. Anyway, here's how to enable the setting:

Open Internet Explorer, click the Tools button,
Click Internet Options. Tap or click the Advanced tab
Under Multimedia, select Play sounds in webpage.
Click Apply, OK. Now check if you can play the mp3 files.

As far as a programmatic fix for this, I don't know of any. You could alert IE users to change their setting, or you could offer a download link as an alternative to the in-browser player.

6
  • I get the same "invalid source" message message but Play sounds in webpage is selected in the options. I am trying to play a wav file and it works correctly on Chrome. Is there anything else I can do? I have tried adding meta http-equiv="X-UA-Compatible" shown in the question and it doesn't work. This is my audio tag: <audio controls src="./audios/mixed.wav">Your browser does not support the <code>audio</code> element.</audio>
    – user13267
    Commented Sep 8, 2020 at 0:46
  • Unchecking Play sounds in webpage gives an Error: Audio playback was aborted message
    – user13267
    Commented Sep 8, 2020 at 0:50
  • gs.statcounter.com/browser-market-share/all/…
    – Ringo
    Commented Sep 8, 2020 at 4:07
  • I don't know if .wav can be played in a browser by default. I would try to convert the file to M4A / MP3
    – Ringo
    Commented Sep 8, 2020 at 4:10
  • Yeah, check out this page. You need to convert .wav to a different format, like .mp4 or .ogg or offer both. en.wikipedia.org/wiki/HTML5_audio If you look at the support table, you can see IE doesn't support .wav, even though MS invented the .wav format. Pretty annoying.
    – Ringo
    Commented Sep 8, 2020 at 4:11
2

This will do the trick:

IE--> Internet Options--> Advanced--> Enable play sounds in webpages.

source: https://forums.asp.net/t/2111915.aspx?Error+Audio+Playback+was+aborted

1

Your source type looks like it may be incorrect. Try this:

<audio controls>
    <source src="myAudioFile.mp3" type="audio/mpeg"/>
</audio>
2
  • Strange. Invalid Source usually only displays if it can't find the audio file you're trying to reference (or the source is corrupt, or an unsupported format). Although it shouldn't matter, have you tried ./myAudioFile.mp3 (referencing the same directory as the HTML file) or /myAudioFile.mp3 (if it's at the root of your web server)? I'm not sure if this would be a problem or not, but do you have all updates installed for IE?
    – J. Titus
    Commented Jan 15, 2016 at 13:23
  • None of these solutions worked. Also, I have all updates installed. I have discovered that it works in IE11 Windows 8.1, but not in my IE11 Windows 7 64 bits.
    – Acel
    Commented Jan 18, 2016 at 15:10
1

Some Times html5 audio tag doesnot work without controls or clear its chaches and try below code if any problem please reply. Hope so you are out of trouble. Have a good day

<!DOCTYPE html>
  <html lang="en">
    <head>
        <meta charset="UTF-8">
        <title>Audio Tag</title>
    </head>
    <body>
        <!--Before HTML5, Developer can add audio tag by Plug-in like  FLASH. But HTML5 introduces an audio tag for embedded an audio media in a web page**strong text**-->

       <audio controls="controls">
          <source src="Allegro%20from%20Duet%20in%20C%20Major.mp3" type="audio/mp3">

        </audio>
    </body>
  </html>
2
  • Original Internet Explorer 11 works only on windows 7 SP1 or server 2008 R2 SP1 and windows 8 + series only Commented Jan 15, 2016 at 11:44
  • It works in IE11 Windows 8.1, but not in my IE11 Windows 7 64 bits.
    – Acel
    Commented Jan 18, 2016 at 15:11

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.