Adaptive Multi-Rate ACELP
audio/amr
Magic Bytes
Offset: 0
23 21 41 4D 52
Adaptive Multi-Rate (AMR) ACELP is an audio compression format standardized by the 3rd Generation Partnership Project (3GPP) for efficient speech coding. It serves as the primary codec for GSM and UMTS mobile telephony networks, facilitating cellular voice calls and low-bitrate voice recordings. While largely superseded by modern wideband alternatives like AMR-WB, the format remains a safe legacy standard supported by most contemporary media players for backward compatibility.
Validation Code
How to validate .amr files in Python
Python
def is_amr(file_path: str) -> bool:
"""Check if file is a valid AMR by magic bytes."""
signature = bytes([0x23, 0x21, 0x41, 0x4D, 0x52])
with open(file_path, "rb") as f:
return f.read(5) == signature
How to validate .amr files in Node.js
Node.js
function isAMR(buffer: Buffer): boolean {
const signature = Buffer.from([0x23, 0x21, 0x41, 0x4D, 0x52]);
return buffer.subarray(0, 5).equals(signature);
}
Go
func IsAMR(data []byte) bool {
signature := []byte{0x23, 0x21, 0x41, 0x4D, 0x52}
if len(data) < 5 {
return false
}
return bytes.Equal(data[:5], signature)
}
API Endpoint
GET
/api/v1/amr
curl https://filesignature.org/api/v1/amr