无法在 IE11 上播放 aac 音频文件

Not able to play aac audio files on IE11

我有一个包含此 html 的页面:

<audio controls="controls">
  <source src="http://techslides.com/demos/samples/sample.aac" type="audio/aac" />
</audio>

它适用于 Firefox 和 Edge,但不适用于 IE11。我的 windows 版本是最新的,我看到它应该得到支持。我尝试更改我的设置以确保 ActiveX 已启用并且确实已启用。

我也试过:

<audio controls="controls" src="http://techslides.com/demos/samples/sample.aac">

也不行。

我能做什么?

我用 IE 11 浏览器测试了示例代码,我能够产生问题。

我尝试查看文档并找到了此信息。

Beginning with Windows Internet Explorer 9, any audio or video content needs the correct mime type set on the server, or the files won't play. Internet Explorer 9 supports MP3 audio, and MP4 audio and video. WebM audio and video files can be supported by installing the WebM components from The WebM project. The following table shows the required settings for your web server to host these files correctly. Microsoft Edge updates introduced WAV support.

参考:

audio element | audio object

您可以看到 .AAC 格式不在列表中,但 MDN 和 CANIUSE 等网站显示它受支持。

我也试过 mp4 音频类型,但也没有用。

<audio controls="controls">
  <source src="http://techslides.com/demos/samples/sample.aac" type="audio/mp4" />
</audio>

也可能是 IE 浏览器的某种错误或与 H.264 格式有关的问题。

作为解决方法,我建议您使用 mp3 文件格式,它在 IE 11 上运行良好。

<!DOCTYPE html>
<html>
<head>
 <title>Page Title</title>
</head>
<body>
<audio controls="controls">
  <source src="https://www.soundhelix.com/examples/mp3/SoundHelix-Song-1.mp3" type="audio/mpeg3" />
</audio>


</body>
</html>