audio tag


Prev Tutorial Next Tutorial

audio tag

Html <audio> tag defines sound, such as music or other audio streams.

Now, there are three supported audio file formats for the <audio> tag; those are given below;

  • MP3
  • Wav
  • Ogg

Browser supported

Audio formats
mp3YesYesYesNoYes
wavYesYesNoYesYes
oggYesYesNoYesNo

Syntax

<!DOCTYPE>
<html>
<body>
<audio controls>
  <source src="/html5/images/song.mp3" type="audio/mpeg">
  Your browser does not support the audio tag.
</audio>
</body>
</html>

Result

MIME Types for Audio Formats

FormatMIME Type
MP3audio/mpeg
Oggaudio/ogg
Wavaudio/wav

Browser supported

Element
<audio>YesYesYesYesYes

Prev Tutorial Next Tutorial

Advertisements




Download Projects