diff options
| author | NotRexed <therealnothingfn@gmail.com> | 2026-11-20 22:28:16 -0500 |
|---|---|---|
| committer | NotRexed <therealnothingfn@gmail.com> | 2026-11-20 22:28:16 -0500 |
| commit | bfba26fbbb4c283a6c19405210deff4e8fc64847 (patch) | |
| tree | 32de92829c8e9a31a50d53c1dbd00fdecd4d1979 /docs/design.md | |
| parent | a16d58e58e9ee7e8b644d676012c98d91510fe4a (diff) | |
Audio: streamed AWC music channels to Ogg Opus
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Diffstat (limited to 'docs/design.md')
| -rw-r--r-- | docs/design.md | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/docs/design.md b/docs/design.md index 4a9166486..50873cec6 100644 --- a/docs/design.md +++ b/docs/design.md | |||
| @@ -77,7 +77,7 @@ add a source file, add it to `runtime\CMakeLists.txt` and to the file list in `b | |||
| 77 | | Models | **Done: 155,598 models** (levels.rpf 149,811 with 1.9 billion triangles, story000 3,303, data 1,350, shared_minigame000 783, packs 314, core_restofworld 37; 0 failures). Exported with `tools\rpf9dump` (built on breadbbbb/rpf9-explorer's Core; see below). Resources are found at page offset +16 after 16 zero bytes, followed by a zlib system blob with a drawable/fragment header and then the following zlib blocks as graphics data. Positions are quantized: `bias + scale * ((q >> 8) & 0xFFFFFF)`. Output is OBJ (positions, UVs, indices) plus a manifest with real model names (e.g. `cvar_int_grg2b_toys_1`), bounds, per-mesh shader index and material texture references (parameter hash, name hash, 64-bit asset key). My earlier `0x1380`/`0x1601` descriptor notes stand, but the "data not located" blocker was wrong. | `<work>\assets\<archive>\models\` | | 77 | | Models | **Done: 155,598 models** (levels.rpf 149,811 with 1.9 billion triangles, story000 3,303, data 1,350, shared_minigame000 783, packs 314, core_restofworld 37; 0 failures). Exported with `tools\rpf9dump` (built on breadbbbb/rpf9-explorer's Core; see below). Resources are found at page offset +16 after 16 zero bytes, followed by a zlib system blob with a drawable/fragment header and then the following zlib blocks as graphics data. Positions are quantized: `bias + scale * ((q >> 8) & 0xFFFFFF)`. Output is OBJ (positions, UVs, indices) plus a manifest with real model names (e.g. `cvar_int_grg2b_toys_1`), bounds, per-mesh shader index and material texture references (parameter hash, name hash, 64-bit asset key). My earlier `0x1380`/`0x1601` descriptor notes stand, but the "data not located" blocker was wrong. | `<work>\assets\<archive>\models\` | |
| 78 | | Texture dictionaries | Same tool: TXD resources become DDS per texture. | `<work>\assets\<archive>\textures\` | | 78 | | Texture dictionaries | Same tool: TXD resources become DDS per texture. | `<work>\assets\<archive>\textures\` | |
| 79 | | World textures (TTPF) | **Done: 308,895 textures from all 57 pools, 0 failures, 48,220 entries skipped** (BCPack or unmapped). 46 pools are in `data\ttdb\**`, 11 in `pack\<name>\data\ttdb\**` (exported under `ttpf_pack\<pack>\`). `data\ttdb\**\*.ttpf` (57 pools, 58 GiB) are loose RDS5 texture pools, **not** inside RPFs. rpf9-explorer's `TtpfReader` reads the catalog and detiles them; checked visually (`ttdb_graphics`: scope reticles, clean lines). Names are generated (`texture_N_<assetkey>`); models reference textures by asset key. Some rows are skipped (BCPack or unmapped shards). | `<work>\assets\ttpf\<pool>\` + `manifest.json` | | 79 | | World textures (TTPF) | **Done: 308,895 textures from all 57 pools, 0 failures, 48,220 entries skipped** (BCPack or unmapped). 46 pools are in `data\ttdb\**`, 11 in `pack\<name>\data\ttdb\**` (exported under `ttpf_pack\<pack>\`). `data\ttdb\**\*.ttpf` (57 pools, 58 GiB) are loose RDS5 texture pools, **not** inside RPFs. rpf9-explorer's `TtpfReader` reads the catalog and detiles them; checked visually (`ttdb_graphics`: scope reticles, clean lines). Names are generated (`texture_N_<assetkey>`); models reference textures by asset key. Some rows are skipped (BCPack or unmapped shards). | `<work>\assets\ttpf\<pool>\` + `manifest.json` | |
| 80 | | Audio | `audio.rpf` holds raw (not zlib) **AWC** banks: Opus (codec 0x0B) and XMA2 streams. Exported as whole `.awc` files plus `audio_manifest.json` (stream ids, codec, channels, rate, duration). **Done: 7,162 banks, 27 GiB, 1,603,231 streams, about 1,324 hours** (codec 0x0B Opus 1,601,167; 5: 1,818; 2: 227; 0 PCM: 19). `tools/awc_opus.py` repackages every Opus stream **losslessly** into a standard Ogg Opus file (no re-encode; PCM streams become .wav). The AWC framing is 2048-byte blocks of [u16 length][packet], with a zero length padding the block (as rpf9-explorer's OpusPreview reads it). The final granule is trimmed to the declared sample count. Checked: 300 random streams decode with ffmpeg with no errors, lengths match the declared counts. Streamed music (tag 0x48, interleaved multi-channel blocks) isn't converted yet. Output: `<work>\assets\audio\ogg\<bank>\<stream id>.ogg`. | `<work>\assets\audio\awc\` | | 80 | | Audio | `audio.rpf` holds raw (not zlib) **AWC** banks: Opus (codec 0x0B) and XMA2 streams. Exported as whole `.awc` files plus `audio_manifest.json` (stream ids, codec, channels, rate, duration). **Done: 7,162 banks, 27 GiB, 1,603,231 streams, about 1,324 hours** (codec 0x0B Opus 1,601,167; 5: 1,818; 2: 227; 0 PCM: 19). `tools/awc_opus.py` repackages every Opus stream **losslessly** into a standard Ogg Opus file (no re-encode; PCM streams become .wav). The AWC framing is 2048-byte blocks of [u16 length][packet], with a zero length padding the block (as rpf9-explorer's OpusPreview reads it). The final granule is trimmed to the declared sample count. Checked: 300 random streams decode with ffmpeg with no errors, lengths match the declared counts. Streamed music (tag 0x48: chunks with a per-channel record table, each channel's 2048-byte subblocks after the aligned header, and a repeated-prefix skip per chunk) becomes one mono Ogg Opus per channel (3,008 banks contain music). Checked: a 4-channel music bank gives four 42.0 s channels with real levels and no decoder errors. Output: `<work>\assets\audio\ogg\<bank>\<stream id>.ogg`. | `<work>\assets\audio\awc\` | |
| 81 | 81 | ||
| 82 | ### rpf9dump (bulk export) | 82 | ### rpf9dump (bulk export) |
| 83 | 83 | ||