audio-meta: join split sound files, fitted header field sizes, child refs for 20 sound classes #39

Manually merged
github merged 6 commits from gh-pr/39/head into gh-pr/39/base 2026-11-26 20:05:00 +00:00
Owner

@⁠holdmysocks on GitHub · 2026-11-23 05:06 UTC · original
holdmysocks:claude/sound-classes → master · +122 −16 · 3 files · 6 commits · merged 2026-11-23 12:14 UTC

  • The main sound file in audio.rpf (schema 166, 241,999 objects) is indexed as two entries, with three stored 64 KiB chunks between them that are not zlib. The chunks fall in the file's second hash table, after the object data, and only that table's length is read. audio-meta now joins the two pieces, fills the gap with zeros and records it as stitched (next entry, gap size and position). Two of the three files that used to fail as "truncated" now decode.
  • Sound header field sizes are fitted on that file so that fixed-size classes get one body length (97% do). Fields 0.1 and 0.3 are 3 bytes (they were 2, or unknown), and 26 more fields get sizes.
  • Child ref offsets are checked on that file. An offset counts when at least 96% of its values are valid object indices that sit nearer the parent in data order than chance. New: classes 3, 9, 10, 19, 24 (a count byte, then that many refs at the end), 29, 31, 36, 40, 41 and 46. Dropped: 16@15 (a bit mask), 30@25 and 48@8 (constant values). Those three only held in the small pack file.
  • Results:
    • In the minigame pack, 2,236 of 2,325 sounds reach a simple sound.
    • In the main file, 92% of 176,428 sounds get children and about half reach a simple sound. Class 16 (name hashes and bit masks) and the parameter classes are not decoded.

Tests: cargo test -p sixng-core audiometa passes.

**@⁠holdmysocks** on GitHub · 2026-11-23 05:06 UTC · [original](https://github.com/holdmysocks/SixNG/pull/39) `holdmysocks:claude/sound-classes` → `master` · +122 −16 · 3 files · 6 commits · merged 2026-11-23 12:14 UTC - The main sound file in `audio.rpf` (schema 166, 241,999 objects) is indexed as two entries, with three stored 64 KiB chunks between them that are not zlib. The chunks fall in the file's second hash table, after the object data, and only that table's length is read. `audio-meta` now joins the two pieces, fills the gap with zeros and records it as `stitched` (next entry, gap size and position). Two of the three files that used to fail as "truncated" now decode. - Sound header field sizes are fitted on that file so that fixed-size classes get one body length (97% do). Fields 0.1 and 0.3 are 3 bytes (they were 2, or unknown), and 26 more fields get sizes. - Child ref offsets are checked on that file. An offset counts when at least 96% of its values are valid object indices that sit nearer the parent in data order than chance. New: classes 3, 9, 10, 19, 24 (a count byte, then that many refs at the end), 29, 31, 36, 40, 41 and 46. Dropped: 16@15 (a bit mask), 30@25 and 48@8 (constant values). Those three only held in the small pack file. - Results: - In the minigame pack, 2,236 of 2,325 sounds reach a simple sound. - In the main file, 92% of 176,428 sounds get children and about half reach a simple sound. Class 16 (name hashes and bit masks) and the parameter classes are not decoded. Tests: `cargo test -p sixng-core audiometa` passes.
The main sound file in audio.rpf is indexed as two entries with three stored
64 KiB chunks between them (in its second hash table, past the object data);
join the pieces and zero the gap. Header field sizes are fitted on its 242k
objects (fields 0.1 and 0.3 are 3 bytes; 26 more fields). Child ref offsets
are checked there: adds classes 3, 9, 10, 19, 24 (count + list), 29, 31, 36,
40, 41 and 46, drops three offsets that only held in the small pack file.
# Conflicts:
#	README.md
github-bot locked as GitHub sync and limited conversation to collaborators 2026-11-26 20:04:58 +00:00
github manually merged commit 946239a5d9 into gh-pr/39/base 2026-11-26 20:05:00 +00:00
This discussion has been locked. Commenting is limited to contributors.
No description provided.