M3A
audio/mpeg
Magic Bytes
Offset: 0
FF F2
M3A is a filename extension utilized for MPEG-1 or MPEG-2 Audio Layer III data, developed by the Moving Picture Experts Group (MPEG) for efficient digital audio encoding. It is primarily employed to store compressed music and voice recordings, functioning technically identically to the ubiquitous MP3 format. Although this specific extension is non-standard and largely obsolete compared to the common MP3 designation, the underlying data remains a widely supported and low-risk standard for audio playback.
Validation Code
How to validate .m3a files in Python
Python
def is_m3a(file_path: str) -> bool:
"""Check if file is a valid M3A by magic bytes."""
signature = bytes([0xFF, 0xF2])
with open(file_path, "rb") as f:
return f.read(2) == signature
How to validate .m3a files in Node.js
Node.js
function isM3A(buffer: Buffer): boolean {
const signature = Buffer.from([0xFF, 0xF2]);
return buffer.subarray(0, 2).equals(signature);
}
Go
func IsM3A(data []byte) bool {
signature := []byte{0xFF, 0xF2}
if len(data) < 2 {
return false
}
return bytes.Equal(data[:2], signature)
}
API Endpoint
GET
/api/v1/m3a
curl https://filesignature.org/api/v1/m3a