Apple Core Audio File
audio/x-caf
Magic Bytes
Offset: 0
63 61 66 66 00 00
Core Audio Format (CAF) is an extensible digital audio container developed by Apple Inc. for managing complex audio data structures. It is frequently employed in professional production for high-resolution recording, surround sound, and long-form content that exceeds the 4 GB limit of legacy formats like AIFF or WAV. As a container format, it is inherently safe, though playback often requires specific codecs or native macOS applications to interpret its metadata and multi-channel streams correctly.
Validation Code
How to validate .caf files in Python
Python
def is_caf(file_path: str) -> bool:
"""Check if file is a valid CAF by magic bytes."""
signature = bytes([0x63, 0x61, 0x66, 0x66, 0x00, 0x00])
with open(file_path, "rb") as f:
return f.read(6) == signature
How to validate .caf files in Node.js
Node.js
function isCAF(buffer: Buffer): boolean {
const signature = Buffer.from([0x63, 0x61, 0x66, 0x66, 0x00, 0x00]);
return buffer.subarray(0, 6).equals(signature);
}
Go
func IsCAF(data []byte) bool {
signature := []byte{0x63, 0x61, 0x66, 0x66, 0x00, 0x00}
if len(data) < 6 {
return false
}
return bytes.Equal(data[:6], signature)
}
API Endpoint
GET
/api/v1/caf
curl https://filesignature.org/api/v1/caf