Audio File MIME Types

Embed Sound in Your Web Pages with the Correct MIME Type

Format
mla apa chicago
Your Citation
Kyrnin, Jennifer. "Audio File MIME Types." ThoughtCo, Sep. 4, 2017, thoughtco.com/audio-file-mime-types-3469485. Kyrnin, Jennifer. (2017, September 4). Audio File MIME Types. Retrieved from https://www.thoughtco.com/audio-file-mime-types-3469485 Kyrnin, Jennifer. "Audio File MIME Types." ThoughtCo. https://www.thoughtco.com/audio-file-mime-types-3469485 (accessed September 26, 2017).
a child ignoring sounds
Sound can be loud or soft. Photodisc / Getty Images

Audio files must be recognized by a Web browser so that the browser knows how to handle it. The standard for identifying file types—Multi Purpose Internet Mail Extensions—stipulates the nature of non-text files transmitted by email. MIME, however, is also used by Web browsers. To embed audio into a Web page, you'll need to verify that the browser understands the file's MIME type.

Embedding Audio

Use MIME types to embed sound files in your Web pages using the HTML4 standard.

Include the MIME type value in the type attribute of the embed element. For example:

<embed src="sunshine.mp3" type="audio/mpeg">

HTML4 doesn't support native playing of audio, just the embedding of the file. You'll need to use a plugin to actually play the file on a page.

In HTML5, the audio element supports the MP3, WAV and OGG formats; if the browser doesn't support the element or the file type, it'll kick back an error message. Using audio allows the browser itself to play back supported sound files without the need for a plugin.

Understanding Mime Types

MIME types associate with common file extenstions. The content-type indicator identfies the extension in greater detail. Content-type tags appear as slashed pairs, with the first term indicating the broad class of what it is—for example, audio or video—and the second term indicating the subtype. An audio type might support dozens of subtypes, including MPEG, WAV and RealAudio specifications.

If the MIME type has been supported by an official Internet standard, the standard will be indicated through a numbered Request for Comments that, when the comment period closes, defines the type or subtype officially. For example, RFC 3003 defines the audio/mpeg MIME type. Not all RFCs are officially approved; some, like RFC 3003, exist in a state of semi-permanent "proposed" status.

Common Audio MIME Types

The following table identifies some of the most common audio-specific MIME types:

Audio File MIME Types

File ExtensionMIME TypeRFC
auaudio/basicRFC 2046
sndaudio/basic 
Linear PCMauido/L24RFC 3190
midaudio/mid 
rmiaudio/mid 
mp3audio/mpegRFC 3003
mp4 audioaudio/mp4 
aifaudio/x-aiff 
aifcaudio/x-aiff 
aiffaudio/x-aiff 
m3uaudio/x-mpegurl 
raaudio/vnd.rn-realaudio 
ramaudio/vnd.rn-realaudio 
Ogg Vorbisaudio/oggRFC 5334
Vorbisaudio/vorbisRFC 5215
wavaudio/vnd.wavRFC 2361
Format
mla apa chicago
Your Citation
Kyrnin, Jennifer. "Audio File MIME Types." ThoughtCo, Sep. 4, 2017, thoughtco.com/audio-file-mime-types-3469485. Kyrnin, Jennifer. (2017, September 4). Audio File MIME Types. Retrieved from https://www.thoughtco.com/audio-file-mime-types-3469485 Kyrnin, Jennifer. "Audio File MIME Types." ThoughtCo. https://www.thoughtco.com/audio-file-mime-types-3469485 (accessed September 26, 2017).