Move BnkExtract onto ritoshark, drop the Wwise toolchain - #7
Open
DexalGT wants to merge 4 commits into
Open
Conversation
Quartz downloaded WwiseConsole.exe and vgmstream-cli.exe from tarngaina/LtMAO into %APPDATA%/RitoShark/AudioTools and shelled out to them. ritoshark f646d96 encodes Wwise Vorbis in-process, which was the only thing that genuinely needed an external toolchain, so both are gone along with the install flow, the progress modal and the needs-tools gating. Any copy an older version left behind is deleted on startup. Decoding was already native but unreachable: audio_decode_to_wav only accepted the result if it came back as wav, and every League wem is Vorbis, so the check never passed and each decode spawned vgmstream anyway. User mp3/flac/ogg/m4a now goes through symphonia, which is the app's side of the boundary rs_audio deliberately draws at PCM samples. Containers moved to rs_audio too: bnk_save_bank rebuilt the bank from scratch on every save, writing a 20-byte BKHD at version 134 with bank id 0 and dropping HIRC and every unmodelled section, and it sorted entries by id so order was lost as well. It now applies the edited entry set to the container the tree was loaded from, so the header and hierarchy survive. Gain no longer round-trips through two processes; it decodes to pcm, scales, and re-encodes into the codec the sound already used.
Picking a skin BIN already tells you which banks belong to it: they share a skin number and a mod root. bnk_locate_banks_for_bin walks up from the BIN to the directory holding data/ or assets/, then reuses the mod-folder matching to pair an audio bank with its events bank, so the folder drop and the file picker cannot disagree. Only empty fields are filled, so an explicit choice is never overwritten, and nothing convincing nearby leaves the fields alone rather than guessing. The scanner body moved into scan_folder_sets so both callers share one copy of the rules.
load_banks returned audio_files alongside the tree, and both carried the full bytes of every embedded wem. The frontend declared audioFiles and hydrated it, but nothing ever read it — the tree leaves are what the UI works from. Tauri serializes Vec<u8> as a JSON number array, so each byte costs roughly three and a half characters and the duplicate doubled that again. Measured on aatrox_base_sfx_audio.bnk: a 3.02 MB bank with 170 entries produced 21.54 MB of IPC JSON, now 10.79 MB. The remaining 3.6x is the number-array encoding itself, which needs the tree to stop carrying audio at all to fix.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Replaces the downloaded Wwise/vgmstream toolchain with in-process Rust, fixes the container corruption in
bnk_save_bank, and fills the bank paths in from a picked BIN.Dropping the toolchain
wwise_installpulledWwiseConsole.exeandvgmstream-cli.exefromtarngaina/LtMAOinto%APPDATA%/RitoShark/AudioToolsand shelled out to them. ritosharkf646d96encodes Wwise Vorbis in-process, which was the only job that genuinely needed an external toolchain, so the install flow, the progress modal and the "needs tools" gating are gone. Anything an older version left behind is deleted on startup.Worth knowing: the prompt only appeared on Replace, Adjust gain, Open in splitter and importing non-
.wemreference files. Loading, playing and extracting never touched it, so plenty of users will never have seen it.Two things replaced it:
encode_vorbis/encode_vorbis_likefrom rs_audio.symphonia. rs_audio deliberately stops at PCM samples, so decoding user files is the app's side of that boundary.Decoding was already native but unreachable
audio_decode_to_wavtried the Rust decoder and then only accepted the resultif decoded.format == "wav". Every League WEM is Wwise Vorbis, so that check never passed and every decode spawnedvgmstreamanyway.Container corruption
bnk_save_bankrebuilt the bank from scratch on every save: a fresh 20-byte BKHD at version 134 with bank id 0,HIRCand every unmodelled section dropped, and entries sorted by id so order was lost too. It now applies the edited entry set to the container the tree was loaded from, so the header, the bank id and the hierarchy survive. The root node already carried its source path, so no new frontend plumbing was needed.One deliberate behaviour change: saving without a recorded source is now an error rather than silently writing a rebuilt bank.
BIN → banks
Picking a skin BIN now fills in the audio and events fields.
bnk_locate_banks_for_binwalks up to the directory holdingdata/orassets/, then reuses the mod-folder matching so the picker and the folder drop cannot disagree. Only empty fields are filled, and nothing convincing nearby leaves them alone rather than guessing.Also
loadCodebook/_codebookplumbing, which every decoder already ignored.scan_folder_setsso both callers share one copy of the matching rules.Verification
291 Rust tests pass (16 new, covering header/hierarchy survival on save, entry removal, verbatim
.wempassthrough, amplify staying Vorbis, WAV round-trip, symphonia decode, and the skin/root path helpers).npm run typecheckand clippy are clean for everything touched.Pre-existing and untouched:
quartz-lib/examples/fbx_top2andfbx_refdon't compile — they usefbxcel, which isn't declared in anyCargo.toml.--lib --binsis green.mp3Bitratestill flows from the UI and still does nothing, since there is no MP3 encoder; the field is kept and documented rather than silently changing the wire contract.Not verified in a running game client — that's the one check that can't be done from here.