Need to refer to different file extension for IE

Good day,

I am using HTML 5

Unfortunately conditional comments are no longer supported starting from IE 10.

I am using this code <audio id="sound" src="file.wav" preload="auto" autoplay controls></audio>

in case of IE it should be

I am using this code <audio id="sound" src="file.mp3" preload="auto" autoplay controls></audio>

<audio id="sound"  preload="auto" autoplay controls>
  <source src="file.wav" type="audio/wav" />
  <source src="file.mp3" type="audio/mp3" />
</audio>

Should play the wav in browsers that understand how to play it and should then play the mp3 in browsers that can’t play wav but can play mp3.

3 Likes

Just in case the member copies this, you should be aware OP that after "audio/mp3 there is no ending quotation " . Make sure you add that if you use his script.

Edited :slight_smile:

Thanks,felgall. It’s working now.Sorry for posting in the wrong forum guys - has nothing to do with Javascript.