Microsoft Windows Media Audio/Video File
application/octet-stream
Magic Bytes
Offset: 0
30 26 B2 75 8E 66 CF 11 A6 D9 00 AA 00 62 CE 6C
The Microsoft Windows Media Audio/Video File format is a proprietary digital container and codec suite developed by Microsoft for its multimedia framework. Primarily used for audio streaming and music storage, it remains compatible with Windows Media Player and various legacy hardware devices. While largely superseded by more efficient standards like MP3 and AAC, this format is generally considered safe as it lacks executable components, though it frequently utilizes digital rights management.
Validation Code
How to validate .wma files in Python
Python
def is_wma(file_path: str) -> bool:
"""Check if file is a valid WMA by magic bytes."""
signature = bytes([0x30, 0x26, 0xB2, 0x75, 0x8E, 0x66, 0xCF, 0x11, 0xA6, 0xD9, 0x00, 0xAA, 0x00, 0x62, 0xCE, 0x6C])
with open(file_path, "rb") as f:
return f.read(16) == signature
How to validate .wma files in Node.js
Node.js
function isWMA(buffer: Buffer): boolean {
const signature = Buffer.from([0x30, 0x26, 0xB2, 0x75, 0x8E, 0x66, 0xCF, 0x11, 0xA6, 0xD9, 0x00, 0xAA, 0x00, 0x62, 0xCE, 0x6C]);
return buffer.subarray(0, 16).equals(signature);
}
Go
func IsWMA(data []byte) bool {
signature := []byte{0x30, 0x26, 0xB2, 0x75, 0x8E, 0x66, 0xCF, 0x11, 0xA6, 0xD9, 0x00, 0xAA, 0x00, 0x62, 0xCE, 0x6C}
if len(data) < 16 {
return false
}
return bytes.Equal(data[:16], signature)
}
API Endpoint
GET
/api/v1/wma
curl https://filesignature.org/api/v1/wma