MPEG-4 Advanced Audio Coding
audio/x-aac
Magic Bytes
Offset: 0
49 44 33
MPEG-4 Advanced Audio Coding (AAC) is a lossy digital audio compression standard developed by the Moving Picture Experts Group (MPEG) as the successor to the MP3 format. It serves as the primary encoding standard for Apple devices, YouTube streaming, and various digital broadcasting infrastructures worldwide. While the format is safe, files containing ID3 metadata tags require updated media player implementations to prevent potential buffer overflow vulnerabilities during header parsing and processing.
Validation Code
How to validate .aac files in Python
Python
def is_aac(file_path: str) -> bool:
"""Check if file is a valid AAC by magic bytes."""
signature = bytes([0x49, 0x44, 0x33])
with open(file_path, "rb") as f:
return f.read(3) == signature
How to validate .aac files in Node.js
Node.js
function isAAC(buffer: Buffer): boolean {
const signature = Buffer.from([0x49, 0x44, 0x33]);
return buffer.subarray(0, 3).equals(signature);
}
Go
func IsAAC(data []byte) bool {
signature := []byte{0x49, 0x44, 0x33}
if len(data) < 3 {
return false
}
return bytes.Equal(data[:3], signature)
}
API Endpoint
GET
/api/v1/aac
curl https://filesignature.org/api/v1/aac