jackz314 / bars-to-bwav

Extracts BWAV files from BARS files (usually used as sound containers in Nintendo Switch games)
MIT License
13 stars 1 forks source link

Does not work on Super Mario Maker II bars #7

Open ultrasound1372 opened 2 years ago

ultrasound1372 commented 2 years ago

Via some cross-checking I've done with this program, a BotW QuickBMS script that produces correct file names but invalid data, and VGMStream's bwav metadata, I've come to the following conclusions for this game at least.

It seems the trick you're doing to just subtract offsets of chained BWAV files is the most effective way to get their length, as I couldn't find any other way to get it, unless the AMTA header has it buried as one of the u32s that follow it. But this code is completely incapable of getting the file names from these files, while the QuickBMS script gets the names but botches finding the length and produces 64K or 0B files, due to the assumption that a BWAV file contains a size. I believe these are AMTA v4 files. While I'm not familiar with the overall structure of AMTA, the presence of a 0x04 byte at headerstart + 7 suggests this. I personally haven't seen AMTA v5 files. If necessary I can send you one for you to examine, and possibly derive more info than I have.

ultrasound1372 commented 2 years ago

Follow-up: The length value appears to not quite be correct, it falls short in some filenames. The manually searching for null appears to be the best way to obtain the name.