feat(audio): parse audio.rpf DAT metadata catalog and auto-name AWC entries #18

Manually merged
github merged 5 commits from gh-pr/18/head into gh-pr/18/base 2026-11-27 02:31:08 +00:00
Owner

@⁠GamingChelsea on GitHub · 2026-11-21 18:53 UTC · original
GamingChelsea:feat/audio-rpf-catalog-naming → main · +664 −36 · 3 files · 5 commits · merged 2026-11-22 02:23 UTC

Summary

audio.rpf (>512 MB) previously skipped the zlib metadata pass, leaving its 18 embedded audio config/DAT containers unindexed and all 7,159 .awc banks named generically (sound_XXXX_Nst.awc).

This PR parses the 19.5 MB metadata prefix of audio.rpf automatically, extracts the BankSizes table (audioconfig DAT26) along with WaveSlot and DAT166 / DAT581 references, applies exact bank byte sizes, and improves the DAT inspector — while keeping raw names searchable and toggleable in the UI.

Changes

  • src/dat.rs:
    • Expanded probe_dat to recognize additional RAGE 9 audio metadata versions (18, 20, 86, 166, 581).
    • Added parse_audio_rpf_catalog to extract the 18 zlib-stitched metadata containers (waveslots2, audioconfig, sounds_common, music_common, game_common, speech2_common, audio_radiostations_and_packs.txt, etc.) from the beginning of audio.rpf.
    • Parsed the 5,955-entry BankSizes table in audioconfig (DAT26), resolved JOAAT pack hashes + WaveSlot / DAT166 / DAT581 bank-hash sound labels (e.g. Animals_Wildlife__ALLIGATOR_GROWL_STREAMING, PoliceScanner, Weapons, Speech_Ped, Resident_Vehicles), and aligned them by size/order via resolve_awc_names_from_catalog (including exact sz1 byte sizes).
    • Upgraded parse_dat to resolve Object Index Table JOAAT hashes to clear-text names and extract up to 500 unique identifiers across the full DAT payload.
    • Added unit test parses_real_audio_rpf_catalog_if_present (alongside probes_and_parses_synthetic_dat26).
  • src/main.rs:
    • Added enrich_audio_rpf_entries during audio.rpf scans and automatic cache upgrades on startup, applying exact BankSizes byte sizes.
    • Added an Audio Names: ON / Audio Names: OFF (Raw) toggle button in the Audio category (audio_named, enabled by default).
    • Indexed both the resolved name and the raw sound_XXXX_Nst.awc name in self.hay so searching by either works in both modes.

[Made with AI]

**@⁠GamingChelsea** on GitHub · 2026-11-21 18:53 UTC · [original](https://github.com/rpatty-dev/PercyStar/pull/18) `GamingChelsea:feat/audio-rpf-catalog-naming` → `main` · +664 −36 · 3 files · 5 commits · merged 2026-11-22 02:23 UTC ## Summary `audio.rpf` (>512 MB) previously skipped the zlib metadata pass, leaving its 18 embedded audio config/DAT containers unindexed and all 7,159 `.awc` banks named generically (`sound_XXXX_Nst.awc`). This PR parses the 19.5 MB metadata prefix of `audio.rpf` automatically, extracts the `BankSizes` table (`audioconfig` DAT26) along with `WaveSlot` and `DAT166` / `DAT581` references, applies exact bank byte sizes, and improves the `DAT` inspector — while keeping raw names searchable and toggleable in the UI. ## Changes - **`src/dat.rs`**: - Expanded `probe_dat` to recognize additional RAGE 9 audio metadata versions (`18`, `20`, `86`, `166`, `581`). - Added `parse_audio_rpf_catalog` to extract the 18 zlib-stitched metadata containers (`waveslots2`, `audioconfig`, `sounds_common`, `music_common`, `game_common`, `speech2_common`, `audio_radiostations_and_packs.txt`, etc.) from the beginning of `audio.rpf`. - Parsed the 5,955-entry `BankSizes` table in `audioconfig` (`DAT26`), resolved JOAAT pack hashes + `WaveSlot` / `DAT166` / `DAT581` bank-hash sound labels (e.g. `Animals_Wildlife__ALLIGATOR_GROWL_STREAMING`, `PoliceScanner`, `Weapons`, `Speech_Ped`, `Resident_Vehicles`), and aligned them by size/order via `resolve_awc_names_from_catalog` (including exact `sz1` byte sizes). - Upgraded `parse_dat` to resolve `Object Index Table` JOAAT hashes to clear-text names and extract up to 500 unique identifiers across the full DAT payload. - Added unit test `parses_real_audio_rpf_catalog_if_present` (alongside `probes_and_parses_synthetic_dat26`). - **`src/main.rs`**: - Added `enrich_audio_rpf_entries` during `audio.rpf` scans and automatic cache upgrades on startup, applying exact `BankSizes` byte sizes. - Added an **`Audio Names: ON` / `Audio Names: OFF (Raw)`** toggle button in the Audio category (`audio_named`, enabled by default). - Indexed both the resolved name and the raw `sound_XXXX_Nst.awc` name in `self.hay` so searching by either works in both modes. [Made with AI]
github-bot locked as GitHub sync and limited conversation to collaborators 2026-11-27 02:31:06 +00:00
github manually merged commit 8baef94bb8 into gh-pr/18/base 2026-11-27 02:31:08 +00:00
Author
Owner

@⁠rpatty-dev on GitHub · 2026-11-22 02:23 UTC · original

Merged onto main (verified 52/52 tests + release build). Really solid work on the audio.rpf DAT catalog and AWC auto-naming!

**@⁠rpatty-dev** on GitHub · 2026-11-22 02:23 UTC · [original](https://github.com/rpatty-dev/PercyStar/pull/18#issuecomment-7072878157) Merged onto main (verified 52/52 tests + release build). Really solid work on the audio.rpf DAT catalog and AWC auto-naming!
This discussion has been locked. Commenting is limited to contributors.
No description provided.