AWC: Add decode diagnostics, 512KB superblock stream splitting, and waveform audio player #10

Closed
github-bot wants to merge 5 commits from gh-pr/10/head into gh-pr/10/base
Owner

@⁠GamingChelsea on GitHub · 2026-11-21 12:35 UTC · original
GamingChelsea:feat/awc-audio-player → main · +1614 −55 · 3 files · 5 commits · closed without merging

Summary

Improves .awc audio decoding, error visibility, memory usage, and playback UX in the Explorer preview pane.

AWC Decoder (src/awc.rs)

  • Detailed decode diagnostics: When 0 streams are decoded, the UI now displays the exact reason (payload too small, non-ADAT magic/compression hint, invalid stream count, seen chunk tags, out-of-bounds/empty chunks, or Opus decoder errors) along with a hex dump and a Copy button.
  • hdr_sz-aligned chunk table fallback: Supports ADAT headers where the 8-byte chunk descriptors are aligned from hdr_sz backwards (e.g. flags=0xFF25, sound_0001_5st.awc) instead of starting at 16 + sc * 4.
  • 512 KB superblock de-interleaving: Detects 0x80000 superblock directories (0xFFFFFFFF + block count per sub-stream) and splits multi-stream .awc files (e.g. _4st) into separate playable streams instead of concatenating interleaved blocks.
  • Truncated 32 MB chunk clamping & higher stream cap: Raises the stream count limit (sc <= 65536) and clamps 0x55 chunk sizes to available payload length when RPF entries are capped at 32 MB.
  • In-memory multi-threaded decoding: Decodes Opus chunks in parallel without writing temporary .wav files to disk.

Waveform Audio Player (src/audio_player.rs, src/main.rs)

  • Full-width virtualized stream list: Uses ScrollArea::show_rows so even banks with 5,000+ streams render smoothly, showing duration, sample rate, channels, and a peak loudness bar (Peak % with tooltip).
  • Docked player overlay: Transport & seek controls (|<, -5s, Play/Pause, Stop, +5s, >|, volume slider), interactive 200-bin peak/RMS waveform seek bar, and live dBFS level meter.
  • Low-RAM on-demand async playback: Retains only ~2 KB of waveform metadata per stream and decodes the selected track's PCM on a background thread on demand.
  • Ring-buffered waveOut playback (Windows): Feeds 4 × ~200 ms buffers via a dedicated feeder thread to prevent audio dropouts on long tracks.

[Made with AI]

21-11-2026;13-35;PercyStar_v1 3 5;9KZSXWDri7;
**@⁠GamingChelsea** on GitHub · 2026-11-21 12:35 UTC · [original](https://github.com/rpatty-dev/PercyStar/pull/10) `GamingChelsea:feat/awc-audio-player` → `main` · +1614 −55 · 3 files · 5 commits · closed without merging ## Summary Improves `.awc` audio decoding, error visibility, memory usage, and playback UX in the Explorer preview pane. ### AWC Decoder (`src/awc.rs`) - **Detailed decode diagnostics**: When 0 streams are decoded, the UI now displays the exact reason (payload too small, non-ADAT magic/compression hint, invalid stream count, seen chunk tags, out-of-bounds/empty chunks, or Opus decoder errors) along with a hex dump and a **Copy** button. - **`hdr_sz`-aligned chunk table fallback**: Supports ADAT headers where the 8-byte chunk descriptors are aligned from `hdr_sz` backwards (e.g. `flags=0xFF25`, `sound_0001_5st.awc`) instead of starting at `16 + sc * 4`. - **512 KB superblock de-interleaving**: Detects `0x80000` superblock directories (`0xFFFFFFFF` + block count per sub-stream) and splits multi-stream `.awc` files (e.g. `_4st`) into separate playable streams instead of concatenating interleaved blocks. - **Truncated 32 MB chunk clamping & higher stream cap**: Raises the stream count limit (`sc <= 65536`) and clamps `0x55` chunk sizes to available payload length when RPF entries are capped at 32 MB. - **In-memory multi-threaded decoding**: Decodes Opus chunks in parallel without writing temporary `.wav` files to disk. ### Waveform Audio Player (`src/audio_player.rs`, `src/main.rs`) - **Full-width virtualized stream list**: Uses `ScrollArea::show_rows` so even banks with 5,000+ streams render smoothly, showing duration, sample rate, channels, and a peak loudness bar (`Peak %` with tooltip). - **Docked player overlay**: Transport & seek controls (`|<`, `-5s`, `Play`/`Pause`, `Stop`, `+5s`, `>|`, volume slider), interactive 200-bin peak/RMS waveform seek bar, and live dBFS level meter. - **Low-RAM on-demand async playback**: Retains only ~2 KB of waveform metadata per stream and decodes the selected track's PCM on a background thread on demand. - **Ring-buffered `waveOut` playback (Windows)**: Feeds 4 × ~200 ms buffers via a dedicated feeder thread to prevent audio dropouts on long tracks. [Made with AI] <img width="1218" height="1186" alt="21-11-2026;13-35;PercyStar_v1 3 5;9KZSXWDri7;" src="https://github.com/user-attachments/assets/9b8fd768-d6e2-45de-b9a5-5f331866fddc" />
github-bot locked as GitHub sync and limited conversation to collaborators 2026-11-27 02:30:58 +00:00
github-bot closed this pull request 2026-11-27 02:30:58 +00:00
Author
Owner

@⁠rpatty-dev on GitHub · 2026-11-21 13:11 UTC · original

Huge thanks @⁠GamingChelsea for the AWC decode diagnostics, 512 KB superblock stream splitting, and waveform audio player! Integrated into main for v1.3.7 with full credit in README & release notes, plus a few optimizations: fixed seek start_frame & decode_gen races, smooth drag scrubbing without re-opening waveOut per frame, zero-copy little-endian ring buffer fills, stream filter, Loop/Auto-Next toggles, WAV export, Space/Left/Right shortcuts, and unified superblock expansion across both decode paths.

**@⁠rpatty-dev** on GitHub · 2026-11-21 13:11 UTC · [original](https://github.com/rpatty-dev/PercyStar/pull/10#issuecomment-7063094331) Huge thanks @⁠GamingChelsea for the AWC decode diagnostics, 512 KB superblock stream splitting, and waveform audio player! Integrated into main for v1.3.7 with full credit in README & release notes, plus a few optimizations: fixed seek start_frame & decode_gen races, smooth drag scrubbing without re-opening waveOut per frame, zero-copy little-endian ring buffer fills, stream filter, Loop/Auto-Next toggles, WAV export, Space/Left/Right shortcuts, and unified superblock expansion across both decode paths.

Pull request closed

This discussion has been locked. Commenting is limited to contributors.
No description provided.