Test files › Audio and video › truncated-header.wav

WAV file with a truncated header

A WAV file cut off after 30 bytes, mid-header.

↓ Download truncated-header.wav
Filenametruncated-header.wav
FormatWAV
Size30 bytes (30 bytes)
MIME typeaudio/wav
SHA-2561a34ac609c1addcfc3c4e0980b57659d1bbc93a942afe4b39d671e3b1d9aa054
What this file catchesParsers that read fixed offsets without bounds-checking and throw an out-of-range error instead of reporting a malformed file.

Handle it in code

Each snippet below was run against this exact file with Python 3.14.4 and Node 24.15.0 when this page was built, and the output shown is what it printed.

Python

Compare what the header declares with what the file holds, and refuse a header that is itself cut short.

import wave

try:
    with wave.open("truncated-header.wav") as w:
        declared = w.getnframes()
        frame_size = w.getsampwidth() * w.getnchannels()
        actual = len(w.readframes(declared)) // frame_size
    note = "truncated or lying header" if actual < declared else "ok"
    print(f"header says {declared} frames, file holds {actual}: {note}")
except (wave.Error, EOFError) as e:
    print("rejected:", str(e) or "the header is cut short")

Run against this file, it prints: rejected: the header is cut short

Related guides and tools

Sample MP3, WAV and MP4 filesFile signaturesMIME typesCheck a file's real typeVerify its SHA-256

Download & verify

curl -fsSL -o "truncated-header.wav" "https://files.hexaqa.com/audio/truncated-header.wav"
curl -fsSL "https://files.hexaqa.com/audio/truncated-header.wav" | sha256sum # expect: 1a34ac609c1addcfc3c4e0980b57659d1bbc93a942afe4b39d671e3b1d9aa054

More audio and video test files

declared-length-mismatch.wavno-id3-raw.mp3silence-30s.wavsilence-5s.mp3tone-5s.wavvery-short-10ms.wavempty-ftyp-only.mp4fake-mp4-wrong-magic.mp4

← All Audio and video files