Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

how can I use html5 <audio> tag to play aac file?

Tags:

html

audio

aac

<audio controls>
  <source src="xxx.aac" type="audio/aac">
</audio>

I can get it to work in safari but doesn't work in chrome and firefox. any solution?

like image 442
user2198903 Avatar asked Mar 22 '13 11:03

user2198903


People also ask

How do I play an AAC file?

How to Play an AAC File. You can open an AAC file with iTunes through the File menu. On a Mac, use the Add to Library option. For Windows, choose either Add File to Library or Add Folder to Library to add the AAC files to your iTunes Library.

Which audio format is not supported by HTML5 audio?

aLaw audio format is not supported by HTML5 audio tag.


1 Answers

Only Safari and IE support .aac. Here is what each browser supports:

  • Internet Explorer 9.0+: .mp3, .aac
  • Chrome: .ogg, .mp3, .wav, .aac*
  • Firefox: .ogg, .wav
  • Safari: .mp3, .aac, .wav
  • Opera: .ogg, .wav

* Chrome seems to support .aac but it isn't included in the list of officially supported file extensions.

I suggest using both .ogg and .mp3 or .ogg and .aac to cover all bases.

References

  • HTML 5 Doctor - HTML5 audio, the state of play
  • Chromium - Audio/Video
like image 87
Daniel Imms Avatar answered Sep 20 '22 12:09

Daniel Imms