Skip to content

SPX (.spx)

.spx file signature | audio/speex

Safe

Magic Bytes

Offset 0
4F 67 67 53 00 2E 2E 2E 2E 2E 2E 2E 2E 2E 2E 2E 2E 2E 2E 2E 2E 2E 2E 2E 2E 2E 2E 2E 53 70 65 65 78 20 20 20

Sources: Apache Tika

Extension

.spx

MIME Type

audio/speex

Byte Offset

0

Risk Level

Safe

Validation Code

How to validate .spx files in Python

Python
def is_spx(file_path: str) -> bool:
    """Check if file is a valid SPX by magic bytes."""
    signature = bytes([0x4F, 0x67, 0x67, 0x53, 0x00, 0x2E, 0x2E, 0x2E, 0x2E, 0x2E, 0x2E, 0x2E, 0x2E, 0x2E, 0x2E, 0x2E, 0x2E, 0x2E, 0x2E, 0x2E, 0x2E, 0x2E, 0x2E, 0x2E, 0x2E, 0x2E, 0x2E, 0x2E, 0x53, 0x70, 0x65, 0x65, 0x78, 0x20, 0x20, 0x20])
    with open(file_path, "rb") as f:
        return f.read(36) == signature

How to validate .spx files in Node.js

Node.js
function isSPX(buffer: Buffer): boolean {
  const signature = Buffer.from([0x4F, 0x67, 0x67, 0x53, 0x00, 0x2E, 0x2E, 0x2E, 0x2E, 0x2E, 0x2E, 0x2E, 0x2E, 0x2E, 0x2E, 0x2E, 0x2E, 0x2E, 0x2E, 0x2E, 0x2E, 0x2E, 0x2E, 0x2E, 0x2E, 0x2E, 0x2E, 0x2E, 0x53, 0x70, 0x65, 0x65, 0x78, 0x20, 0x20, 0x20]);
  return buffer.subarray(0, 36).equals(signature);
}

How to validate .spx files in Go

Go
func IsSPX(data []byte) bool {
    signature := []byte{0x4F, 0x67, 0x67, 0x53, 0x00, 0x2E, 0x2E, 0x2E, 0x2E, 0x2E, 0x2E, 0x2E, 0x2E, 0x2E, 0x2E, 0x2E, 0x2E, 0x2E, 0x2E, 0x2E, 0x2E, 0x2E, 0x2E, 0x2E, 0x2E, 0x2E, 0x2E, 0x2E, 0x53, 0x70, 0x65, 0x65, 0x78, 0x20, 0x20, 0x20}
    if len(data) < 36 {
        return false
    }
    return bytes.Equal(data[:36], signature)
}

API Endpoint

GET /api/v1/spx
curl https://filesignature.org/api/v1/spx

See the full API documentation for all endpoints and parameters.

Frequently Asked Questions

What is a .spx file?

A .spx file is a SPX file.

What are the magic bytes for .spx files?

The magic bytes for SPX files are 4F 67 67 53 00 2E 2E 2E 2E 2E 2E 2E 2E 2E 2E 2E 2E 2E 2E 2E 2E 2E 2E 2E 2E 2E 2E 2E 53 70 65 65 78 20 20 20 at byte offset 0. These bytes uniquely identify the file format regardless of the file extension.

How do I validate a .spx file?

To validate a .spx file, read the first bytes of the file and compare them against the known magic bytes (4F 67 67 53 00 2E 2E 2E 2E 2E 2E 2E 2E 2E 2E 2E 2E 2E 2E 2E 2E 2E 2E 2E 2E 2E 2E 2E 53 70 65 65 78 20 20 20) at offset 0. This is more reliable than checking the file extension alone, as extensions can be renamed.

What is the MIME type for .spx files?

The primary MIME type for .spx files is audio/speex.

Is it safe to open .spx files?

SPX (.spx) files are generally safe to open. They are classified as low risk because they primarily contain data rather than executable code. However, always ensure files come from a trusted source.