Media type / audio
audio/mp4
An MPEG-4 container carrying only audio, which is what an .m4a file actually is.
Served inline: Browsers display this in the tab without granting it script access to the page. Safe to serve inline, provided the bytes really are what the header claims.
Browser behaviour
Renders inertly
Charset
no charset
Compression
Already compressed
Send it like this
Content-Type: audio/mp4A binary payload has no character encoding. A charset parameter here is meaningless and occasionally confuses strict parsers.
Handling verdict
Browsers display this in the tab without granting it script access to the page. Safe to serve inline, provided the bytes really are what the header claims.
A binary payload has no character encoding. A charset parameter here is meaningless and occasionally confuses strict parsers.
The format compresses internally. Another transport encoding costs CPU on both ends and typically changes the size by less than a percent — sometimes upward.
Registered with IANA through a public review process, so the name is stable and every implementation can rely on it meaning the same thing.
Anatomy of the name
RFC 6838Top-level type
audio
Audio
Subtype
mp4
Registered in the standards tree.
Structured syntax
none
No suffix, so the payload format is defined entirely by the subtype itself.
Parameters
codecs
Defined for this type in addition to any charset rule above.
What trips people up
1 note- The codecs parameter (for example codecs="mp4a.40.2") lets a player decide whether it can play the file before downloading it.
Response headers
Content-Type: audio/mp4
X-Content-Type-Options: nosniff
Content-Disposition: inlinenosniff stops the browser second-guessing the type you declared, which is what makes the rest of this reliable. Serving it inline is safe here because the browser renders it without granting it script access.
Server configuration
extension mappingnginx
types {
audio/mp4 m4a mp4a;
}Apache
AddType audio/mp4 .m4a .mp4aCaddy
@type path *.m4a *.mp4a
header @type Content-Type "audio/mp4"Extensions and other spellings
declaredFile extensions
File signature
No fixed signature — this format has no reliable magic number, so identify it by parsing rather than by the first few bytes.