Handle AWC hdr24 block_samples/skip overlap and add GAME.DAT/SOUNDS.DAT metadata parser #1
No reviewers
Labels
No labels
accessibility
bug
documentation
duplicate
enhancement
good first issue
help wanted
invalid
question
wontfix
No milestone
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
github/Albotterin--AWC_from_RPF9_Extractor!1
Loading…
Reference in a new issue
No description provided.
Delete branch "gh-pr/1/head"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
@Elijah-J on GitHub · 2026-11-24 17:48 UTC · original
Elijah-J:feat/awc-block-skip-and-audmetadata→main· +1010 −63 · 4 files · 5 commits · closed without mergingSummary
Streamed AWC (
0x48/0x55) block budget & skip handling (awc_core.py,docs/FORMAT.md):(ents, skip_samples, block_samples)from each channel's 24-byte block header (+0x04..+0x10).block_samples / opus_channelsand discards later packets in the block. The existing Ogg writer can retain final-frame padding.Deterministic
GAME.DAT/SOUNDS.DAT(audMetadataFile0x045A88EA) parser (awc_metadata.py,docs/FORMAT.md):audMetadataFileblobs, including stored chunks a zlib-only carve can miss, locatesGAME.DATviajoaat("RADIO_STATIONS_01"), enumeratesRADIO_STATIONS_01..16(0x0E) ->RadioStationSettings(0x10, including static world-emitter(flags & 0x30) == 0x10and hidden wheel(flags & 0x0C) == 0x04bits) ->RadioStationTrackList(0x11, externalObjectList0x02or inline refs) ->RadioTrackSettings(0x0F), and resolvesSOUNDS.DATStreamingSound(0x08) ->SimpleSound(0x0C)(bank_hash, wave_hash & 0x1FFFFFFF)for complete adjacent child groups, including checked multi-stem club/venue mixes. Also enumerates unattached tracklists.Synthetic tests (
tests/test_awc_metadata_and_blocks.py):PYTHONPATH=. python3 -W error -m unittest discover -s tests -v— 10/10 OK (zero warnings, synthetic fixtures only, no game files).python3 -m compileall -q awc_core.py awc_metadata.py tests/test_awc_metadata_and_blocks.py— exit 0.Opened as a Draft PR for review before marking ready.
@Copilot on GitHub · 2026-11-24 18:30 UTC · original
On
awc_core.pyline 337 (outdated):_estimate()only probes the first block, so a mono stream with an empty initial block retains the default channel count of 2 here. A later block with two 960-frame mono packets and a 1920-sample budget then loses its second packet. Infer the channel count from the first available packet before converting budgets and skips, as the Ogg writer does.@copilot-pull-request-reviewer[bot] on GitHub · 2026-11-24 18:30 UTC · original · reviewed
🟡 Changes recommended
Unresolved issues allow stale state to affect skip reconciliation, incorrect channel inference to drop mono packets, and metadata arrays to consume adjacent objects’ bytes.
3 open issues
What changed in this PR
This PR improves streamed AWC extraction and adds a standalone parser for radio metadata in
GAME.DATandSOUNDS.DAT.Changes:
tests/test_awc_metadata_and_blocks.pydocs/FORMAT.mdawc_metadata.pyawc_core.pyReview effort: Balanced
@Copilot on GitHub · 2026-11-24 18:30 UTC · original
On
awc_core.pyline 394 (outdated):An empty block leaves both previous-block state values unchanged, so a later skip can be accepted using an older block's deficit or overlap history. An empty block with a positive budget also fails to record its own shortfall. Update overlap history and deficit for every block, including empty ones, so skip reconciliation uses the immediately preceding block.
@Copilot on GitHub · 2026-11-24 18:30 UTC · original
On
awc_metadata.pyline 182 (outdated):These array bounds use the end of the metadata section rather than the containing object's span, so a truncated array can consume the next object's bytes as references and attach unrelated tracks or stations. Bound each array by the next object offset (or
meta_sizefor the final object) and reject counts that exceed that span. The same issue affects inline track references at line 186, station references at line 235, and station tracklist entries at line 252 in this file.@Elijah-J on GitHub · 2026-11-24 22:24 UTC · original
The three review findings are addressed in
dfcd185. The extractor reads each stream’s first available Opus packet to determine its channel count, uses the immediately preceding block for skip recovery, and bounds metadata reference arrays to their containing objects.All 17 tests passed. The parsed metadata matched the previous results. All 11 sampled Ogg Opus exports matched the previous exports byte for byte, and FFmpeg decoded each one successfully.
Pull request closed