{
"schema": "wav-conformance-vectors/1",
"generator": "tools/gen_fixtures.py",
"vector_kinds": {
"valid": "must parse; expected spec and samples listed; canonical files must round-trip byte-exact through the writer",
"error": "must fail with a clean Err at the listed stage; must never panic and never end cleanly with fewer samples",
"tolerated": "malformed in a way the reader deliberately accepts; expected samples listed",
"perf": "benchmark input, regenerated on demand"
},
"vectors": [
{
"id": "V01",
"file": "fixtures/pcm-u8-mono-odd.wav",
"len": 50,
"sha256": "e203e32a854d083dda26f756972a94250924398e2d22d6a39a2a15e654063417",
"kind": "valid",
"hex": "524946462a00000057415645666d7420100000000100010044ac000044ac000001000800646174610500000000017f80ff00",
"spec": {
"channels": 1,
"sample_rate": 44100,
"bits_per_sample": 8,
"sample_format": "int"
},
"expect": {
"samples_u8": [
0,
1,
127,
128,
255
],
"canonical": true,
"note": "data length 5 is odd; one zero pad byte follows and is counted in the RIFF size but not the data size. On-disk 8-bit samples are offset-binary (unsigned, midpoint 128); samples_u8 lists the stored bytes."
},
"notes": "Round-trip: canonical writer output must equal these bytes, including the pad byte and even RIFF size."
},
{
"id": "V02",
"file": "fixtures/pcm-i16-stereo.wav",
"len": 60,
"sha256": "fce497a395aed1fc1d0698f0af8b8cd25f953c63d451cada40c0f7f0018fa708",
"kind": "valid",
"hex": "524946463400000057415645666d7420100000000100020044ac000010b1020004001000646174611000000000000100ffffff7f00803930c7cf0001",
"spec": {
"channels": 2,
"sample_rate": 44100,
"bits_per_sample": 16,
"sample_format": "int"
},
"expect": {
"samples_i16": [
0,
1,
-1,
32767,
-32768,
12345,
-12345,
256
],
"canonical": true
}
},
{
"id": "V03",
"file": "fixtures/pcm-i24-mono-odd.wav",
"len": 60,
"sha256": "ecfd459d728546be09961931a27a050d8ae3e04d1357bb2f9577f73ba794f250",
"kind": "valid",
"hex": "524946463400000057415645666d7420100000000100010080bb00008032020003001800646174610f000000000000010000ffffffffff7f00008000",
"spec": {
"channels": 1,
"sample_rate": 48000,
"bits_per_sample": 24,
"sample_format": "int"
},
"expect": {
"samples_i32": [
0,
1,
-1,
8388607,
-8388608
],
"canonical": true,
"note": "15-byte data chunk, pad byte required"
}
},
{
"id": "V04",
"file": "fixtures/pcm-i32-stereo.wav",
"len": 68,
"sha256": "948997d9696a146a7b87ef219d948001f0e5ca9d9eadfbece5793124ddcd2602",
"kind": "valid",
"hex": "524946463c00000057415645666d742010000000010002000077010000b80b000800200064617461180000000000000001000000ffffffffffffff7f0000008000000100",
"spec": {
"channels": 2,
"sample_rate": 96000,
"bits_per_sample": 32,
"sample_format": "int"
},
"expect": {
"samples_i32": [
0,
1,
-1,
2147483647,
-2147483648,
65536
],
"canonical": true
}
},
{
"id": "V05",
"file": "fixtures/float-f32-mono.wav",
"len": 78,
"sha256": "ecca1e69d08c9142146ad4d5ece4e752f1074f2a0ce121ff5af184066ce500bd",
"kind": "valid",
"hex": "524946464600000057415645666d7420120000000300010044ac000010b102000400200000006661637404000000050000006461746114000000000000000000803f000080bf0000003f000080be",
"spec": {
"channels": 1,
"sample_rate": 44100,
"bits_per_sample": 32,
"sample_format": "float"
},
"expect": {
"samples_f32_lebits": [
"00000000",
"0000803f",
"000080bf",
"0000003f",
"000080be"
],
"canonical": true,
"note": "WAVEFORMATEX (fmt len 18, cbSize 0) + fact chunk, the canonical non-PCM layout"
}
},
{
"id": "V06",
"file": "fixtures/float-f64-stereo.wav",
"len": 106,
"sha256": "42214e3daf48c3d2893df5d5bdf4412906dd8670aafc250d8e14e3266384b336",
"kind": "valid",
"hex": "524946466200000057415645666d7420120000000300020044ac000040c40a0010004000000066616374040000000300000064617461300000000000000000000000000000000000f03f000000000000f0bf000000000000e03f182d4454fb2109400000000000001080",
"spec": {
"channels": 2,
"sample_rate": 44100,
"bits_per_sample": 64,
"sample_format": "float"
},
"expect": {
"samples_f64_lebits": [
"0000000000000000",
"000000000000f03f",
"000000000000f0bf",
"000000000000e03f",
"182d4454fb210940",
"0000000000001080"
],
"canonical": true
},
"notes": "IEEE float 64 stereo, canonical writer output."
},
{
"id": "V07",
"file": "fixtures/extensible-i16-stereo.wav",
"len": 88,
"sha256": "d1012a0ce6c02158c31ffbcd88af8f782baa4e81c8a345760051677442b20462",
"kind": "valid",
"hex": "524946465000000057415645666d742028000000feff020080bb000000ee02000400100016001000030000000100000000001000800000aa00389b7166616374040000000200000064617461080000000100020003000400",
"spec": {
"channels": 2,
"sample_rate": 48000,
"bits_per_sample": 16,
"sample_format": "int"
},
"expect": {
"samples_i16": [
1,
2,
3,
4
],
"channel_mask": 3,
"valid_bits_per_sample": 16
}
},
{
"id": "V08",
"file": "fixtures/extensible-f32-5ch1.wav",
"len": 104,
"sha256": "76831acc026cebc8bb3ac490da7d419fec6cdbc81aaa4dd740f3ee32d07ef6a4",
"kind": "valid",
"hex": "524946466000000057415645666d742028000000feff060080bb00000094110018002000160020003f0000000300000000001000800000aa00389b716661637404000000010000006461746118000000000000000000003e000000be0000803f000080bf0000403f",
"spec": {
"channels": 6,
"sample_rate": 48000,
"bits_per_sample": 32,
"sample_format": "float"
},
"expect": {
"samples_f32_lebits": [
"00000000",
"0000003e",
"000000be",
"0000803f",
"000080bf",
"0000403f"
],
"channel_mask": 63,
"valid_bits_per_sample": 32
}
},
{
"id": "V09",
"file": "fixtures/extensible-i24in32-stereo.wav",
"len": 104,
"sha256": "73937be808697f5adaa915afcf014673802014ff641868b0ba04db879e98ef26",
"kind": "valid",
"hex": "524946466000000057415645666d742028000000feff020080bb000000dc05000800200016001800030000000100000000001000800000aa00389b71666163740400000003000000646174611800000001000000020000000300000004000000ffffffffffff7f00",
"spec": {
"channels": 2,
"sample_rate": 48000,
"bits_per_sample": 24,
"sample_format": "int",
"container_bytes_per_sample": 4
},
"expect": {
"samples_i32": [
1,
2,
3,
4,
-1,
8388607
],
"channel_mask": 3,
"valid_bits_per_sample": 24,
"canonical": false,
"note": "24 valid bits in 4-byte containers; decode sign-extends bits 0..23. Seeking must advance by the container size (4 bytes/sample), not valid_bits/8."
},
"notes": "24 valid bits in 4-byte EXTENSIBLE containers. ffmpeg 8.1.2 misidentifies this layout as pcm_f24le and decodes silence. Decode uses container = block_align/channels and the low wValidBitsPerSample bits, sign-extended."
},
{
"id": "V10",
"file": "fixtures/odd-junk-chunk-padded.wav",
"len": 60,
"sha256": "da0e60824db9867f49de5bd0fbc5d521c17107d37b2fec2c27f243ab5627ef34",
"kind": "valid",
"hex": "524946463400000057415645666d7420100000000100010044ac000088580100020010004a554e4b0300000078797a00646174610400000001000200",
"spec": {
"channels": 1,
"sample_rate": 44100,
"bits_per_sample": 16,
"sample_format": "int"
},
"expect": {
"samples_i16": [
1,
2
],
"note": "unknown 3-byte JUNK chunk followed by its mandatory pad byte; a conforming reader skips size+pad"
},
"notes": "Odd-sized JUNK chunk with a zero pad byte before data. The reader skips the payload and the pad."
},
{
"id": "V11",
"file": "fixtures/fact-len-8.wav",
"len": 64,
"sha256": "732d8c2ff5d42746211a34174d2bf7547b1da23017f991696f90e55ed6f96eac",
"kind": "valid",
"hex": "524946463800000057415645666d7420100000000100010044ac0000885801000200100066616374080000000400000009090909646174610400000001000200",
"spec": {
"channels": 1,
"sample_rate": 44100,
"bits_per_sample": 16,
"sample_format": "int"
},
"expect": {
"samples_i16": [
1,
2
],
"note": "fact chunk longer than 4 bytes; reader must skip the remainder using the declared chunk size"
},
"notes": "fact chunk of size 8. The reader skips the whole chunk by its declared size."
},
{
"id": "V12",
"file": "fixtures/data-not-last.wav",
"len": 60,
"sha256": "a1e30d5fe40034e23fd659ae7368973fe3fa3c2746feb063e694a41cc4ed18b0",
"kind": "valid",
"hex": "524946463400000057415645666d7420100000000100010044ac000044ac000001000800646174610300000001020300637565200400000000000000",
"spec": {
"channels": 1,
"sample_rate": 44100,
"bits_per_sample": 8,
"sample_format": "int"
},
"expect": {
"samples_u8": [
1,
2,
3
],
"note": "data chunk is odd-length, padded, and followed by another chunk; the reader must stop at the declared data size and must not decode the pad byte as a sample"
}
},
{
"id": "V13",
"file": "fixtures/waveformatex-pcm-i16.wav",
"len": 50,
"sha256": "5226123de160dc42b73b746cc9fced80fbad01ae677ba4cacc12a560d1205d88",
"kind": "valid",
"hex": "524946462a00000057415645666d7420120000000100010044ac00008858010002001000000064617461040000000700f9ff",
"spec": {
"channels": 1,
"sample_rate": 44100,
"bits_per_sample": 16,
"sample_format": "int"
},
"expect": {
"samples_i16": [
7,
-7
],
"note": "PCM inside an 18-byte WAVEFORMATEX (cbSize=0)"
}
},
{
"id": "X01",
"file": "fixtures/trailing-partial-declared.wav",
"len": 49,
"sha256": "24843fbb8c1537b2a8d8f58fc9b62d73a6092d44be802e4bd9634bcc2aae3763",
"kind": "error",
"hex": "524946462900000057415645666d7420100000000100010044ac0000885801000200100064617461050000000100020003",
"spec": {
"channels": 1,
"sample_rate": 44100,
"bits_per_sample": 16,
"sample_format": "int"
},
"expect": {
"error_stage": "open",
"error_class": "data length not a multiple of the frame size"
},
"notes": "Declared data size 5 with 16-bit samples, not a whole number of frames. Fail at open."
},
{
"id": "X02",
"file": "fixtures/truncated-mid-sample.wav",
"len": 49,
"sha256": "544a1441addea3fe2db79e4bd56913ff638bba9b5d3add59e9cb9ac10c435e35",
"kind": "error",
"hex": "524946462900000057415645666d7420100000000100010044ac0000885801000200100064617461060000000100020003",
"spec": {
"channels": 1,
"sample_rate": 44100,
"bits_per_sample": 16,
"sample_format": "int"
},
"expect": {
"error_stage": "stream",
"error_class": "unexpected end of stream inside a sample",
"samples_before_error_max": 2
},
"notes": "Declared data size 6 with only 5 bytes present. Yield the whole 16-bit sample prefix, then one error."
},
{
"id": "X03",
"file": "fixtures/stray-byte-after-data.wav",
"len": 49,
"sha256": "b7ab89f0f5d1a62a1534af29f6f69e761ceabd18608e6bfbcf76735af67c70b0",
"kind": "tolerated",
"hex": "524946462900000057415645666d7420100000000100010044ac0000885801000200100064617461040000000100020003",
"spec": {
"channels": 1,
"sample_rate": 44100,
"bits_per_sample": 16,
"sample_format": "int"
},
"expect": {
"samples_i16": [
1,
2
],
"note": "one stray byte past the declared data size, at EOF; the declared chunk boundary governs, so this reads as exactly 2 samples. Readers never scan past the data chunk they were asked to decode."
}
},
{
"id": "X04",
"file": "fixtures/odd-junk-chunk-unpadded.wav",
"len": 59,
"sha256": "1838c7abfb84ab8bafefc93ec9a9c720f3e78005474285a6cbf70d7e47a02fcf",
"kind": "error",
"hex": "524946463300000057415645666d7420100000000100010044ac000088580100020010004a554e4b0300000078797a646174610400000001000200",
"spec": {
"channels": 1,
"sample_rate": 44100,
"bits_per_sample": 16,
"sample_format": "int"
},
"expect": {
"error_stage": "open",
"error_class": "malformed chunk stream (pad byte missing after odd chunk)"
},
"notes": "Odd-sized JUNK chunk with no pad byte. The next chunk header follows the payload immediately. Fail at open."
},
{
"id": "X05",
"file": "fixtures/truncated-header.wav",
"len": 16,
"sha256": "d85aa82a0a8d1e13226fd4c1af042bf8b194b3288b4fb8da54d356e4f7be8349",
"kind": "error",
"hex": "524946461000000057415645666d7420",
"expect": {
"error_stage": "open",
"error_class": "unexpected end of file"
}
},
{
"id": "X06",
"file": "fixtures/fmt-too-short.wav",
"len": 36,
"sha256": "316580494b65ac0430b21f1b675ce2edaccc7f0261f57f5e16f39364101f9f39",
"kind": "error",
"hex": "524946461c00000057415645666d7420080000000100010044ac00006461746100000000",
"expect": {
"error_stage": "open",
"error_class": "fmt chunk too small"
}
},
{
"id": "X07",
"file": "fixtures/data-before-fmt.wav",
"len": 48,
"sha256": "3bddcec11bcea794e98a85601271911dee74c708c5d7a2b928874a1878bf61dd",
"kind": "error",
"hex": "524946462800000057415645646174610400000001000200666d7420100000000100010044ac00008858010002001000",
"expect": {
"error_stage": "open",
"error_class": "data chunk before fmt chunk"
}
},
{
"id": "X08",
"file": "fixtures/huge-declared-data.wav",
"len": 48,
"sha256": "6dbca3965a8bb48788ea7a77c35021757f01ee8822a1eb13f4352f7608c1d9c9",
"kind": "error",
"hex": "524946462800000057415645666d7420100000000100010044ac0000885801000200100064617461f0ffffff01000200",
"spec": {
"channels": 1,
"sample_rate": 44100,
"bits_per_sample": 16,
"sample_format": "int"
},
"expect": {
"error_stage": "stream",
"error_class": "unexpected end of stream inside the data chunk",
"samples_before_error_max": 2
},
"notes": "Declared data size near 4 GiB with four bytes present. Yield the whole-sample prefix, then one error. len reports the declared count."
},
{
"id": "X09",
"file": "fixtures/zero-channels.wav",
"len": 46,
"sha256": "c237051dccecb491315ea0607340ca66c73ab712e3d451d08077a18e6f63630e",
"kind": "error",
"hex": "524946462600000057415645666d7420100000000100000044ac0000885801000200100064617461020000000100",
"expect": {
"error_stage": "open",
"error_class": "zero channels"
}
},
{
"id": "X10",
"file": "fixtures/zero-block-align.wav",
"len": 46,
"sha256": "4ba933410dec3e8d1e2fa44f976a5649df22e54b21ebf19d18032f610699d5cc",
"kind": "error",
"hex": "524946462600000057415645666d7420100000000100010044ac0000000000000000100064617461020000000100",
"expect": {
"error_stage": "open",
"error_class": "block alignment inconsistent with channels/bits (and no divide-by-zero panic)"
}
},
{
"id": "X11",
"file": "fixtures/extensible-unknown-guid.wav",
"len": 72,
"sha256": "dd271078d01a2c1f0bcae149ac81ce2a6772e8220175d77549d9faf417eb404f",
"kind": "error",
"hex": "524946464000000057415645666d742028000000feff020080bb000000ee0200040010001600100003000000deadbeef000000000000000000000000646174610400000001000200",
"expect": {
"error_stage": "open",
"error_class": "unsupported sub-format GUID"
}
},
{
"id": "X12",
"file": "fixtures/not-riff.wav",
"len": 64,
"sha256": "fdeab9acf3710362bd2658cdc9a29e8f9c757fcf9811603a8c447cd1d9151108",
"kind": "error",
"hex": "000102030405060708090a0b0c0d0e0f101112131415161718191a1b1c1d1e1f202122232425262728292a2b2c2d2e2f303132333435363738393a3b3c3d3e3f",
"expect": {
"error_stage": "open",
"error_class": "not a RIFF file"
}
},
{
"id": "X13",
"file": "fixtures/f64-trailing-partial.wav",
"len": 70,
"sha256": "34b783815a9d6047c472b5eedcd0537e5f38896b0b3db31a82d4020c75affa3b",
"kind": "error",
"hex": "524946463e00000057415645666d7420120000000300010044ac000020620500080040000000666163740400000001000000646174610c000000000000000000e03f01020304",
"spec": {
"channels": 1,
"sample_rate": 44100,
"bits_per_sample": 64,
"sample_format": "float"
},
"expect": {
"error_stage": "open",
"error_class": "data length not a multiple of the frame size"
},
"notes": "Declared data size 12 with 8-byte float64 samples, not a whole number of frames. Fail at open."
},
{
"id": "P01",
"file": "fixtures/perf-large-i16-stereo.wav",
"len": 5292044,
"sha256": "9ee169b5590ac107c700a170f848bfbee78683e54d8a547b40e96c8ea0e58f33",
"kind": "perf",
"spec": {
"channels": 2,
"sample_rate": 44100,
"bits_per_sample": 16,
"sample_format": "int"
},
"expect": {
"note": "30 s stereo 16-bit LCG noise (seed 0, C rand constants). Used by the large-file read benchmark; regenerate with tools/gen_fixtures.py rather than committing."
}
}
]
}