Since the only extractor for BOTW's .bars files I could find on this forum was Windows-only and I'm not a huge fan of that, I spent the last night reverse-engineering the BARS format used in BOTW and wrote a cross-platform extractor myself: https://gist.github.com/SamusAranX/6eb8b6fd1777b17afc3107a979c2409a
I subsequently posted it here: http://gbatemp.net/threads/tutorial...reath-of-the-wild.463642/page-24#post-7357406, but created this new thread so it could get more eyes on it. Hope that's okay.
While sifting through the data, I noticed there was another format with "FSTP" headers in the .bars files, and so far, it seems as if there's no converter for these yet. As I wrote in the information section below, I think they're 4 bit mono ADPCM files at 32000 Hz, but Audacity doesn't support importing that.
bars_extractor.py will extract these as .bfstp files so they can be converted when someone comes up with a converter.
If you want to have a crack at it, but lack the necessary files, try these:
MusicianThemeBgm_Event_BGM_MusicianThemeE.bfstp (with all headers and information)
MusicianThemeBgm_Event_BGM_MusicianThemeE.raw (headers and information stripped)
MusicianThemeBgm_Event_BGM_MusicianThemeE.wav (VERY LOUD! The above, imported into Audacity and exported to WAV)
As you can hear, there's definitely music in there, I just can't decode it into a proper format because I lack the tools.
Usage information and examples can be found on the Gist's page, but I'll copy the gist of it (heh) so you can read it here.
I subsequently posted it here: http://gbatemp.net/threads/tutorial...reath-of-the-wild.463642/page-24#post-7357406, but created this new thread so it could get more eyes on it. Hope that's okay.
While sifting through the data, I noticed there was another format with "FSTP" headers in the .bars files, and so far, it seems as if there's no converter for these yet. As I wrote in the information section below, I think they're 4 bit mono ADPCM files at 32000 Hz, but Audacity doesn't support importing that.
bars_extractor.py will extract these as .bfstp files so they can be converted when someone comes up with a converter.
If you want to have a crack at it, but lack the necessary files, try these:
MusicianThemeBgm_Event_BGM_MusicianThemeE.bfstp (with all headers and information)
MusicianThemeBgm_Event_BGM_MusicianThemeE.raw (headers and information stripped)
MusicianThemeBgm_Event_BGM_MusicianThemeE.wav (VERY LOUD! The above, imported into Audacity and exported to WAV)
As you can hear, there's definitely music in there, I just can't decode it into a proper format because I lack the tools.
Usage information and examples can be found on the Gist's page, but I'll copy the gist of it (heh) so you can read it here.
Usage
orCode:$ python3 bars_extractor.py [list of BARS files]
Code:$ python3 bars_extractor.py *.bars
bars_extractor.py will only accept the wildcard syntax if "*.bars" is the only parameter.
Information
Example
- bars_extractor.py always overwrites files when extracting.
- File names will be trimmed to fit into significantly less than 255 characters. In BOTW's files, there's at least one BARS file that contains a track name that is exactly 255 chars long, which is too much for most file systems. Check line 114 if you want to disable the trimming.
- Most of the time, BARS files contain a bunch of BFWAV files that can be easily converted (or played back in foobar2000, for example), but sometimes there are files with an "FSTP" header. As of now, this seems to be an unknown format (because I can't find anything about it), but in case someone wants to tinker with the files, bars_extractor.py will attempt to extract them into files with the .bfstp extension.
- I think they're 4 bit ADPCM files with one channel at a sample rate of 32000 Hz, but I currently lack the tools to test that.
Code:$ python3 bars_extractor.py KorokPot.bars KorokPot.bars: 8 Tracks found: KorokPot.bars: Saved track 1 to KorokPot_KorokPot_Slide01.bfwav KorokPot.bars: Saved track 2 to KorokPot_KorokPot_Break01.bfwav KorokPot.bars: Saved track 3 to KorokPot_KorokPot_Land02.bfwav KorokPot.bars: Saved track 4 to KorokPot_KorokPot_Slide00.bfwav KorokPot.bars: Saved track 5 to KorokPot_KorokPot_Break00.bfwav KorokPot.bars: Saved track 6 to KorokPot_KorokPot_Break02.bfwav KorokPot.bars: Saved track 7 to KorokPot_KorokPot_Land00.bfwav KorokPot.bars: Saved track 8 to KorokPot_KorokPot_Land01.bfwav
Changes
Version 1.1
- Moved script logic to a separate function that's called from main()
- Added a new FWAV header for experimental extraction
- Changed all structs from signed to unsigned values
- Now correctly jumps to AMTA offsets instead of assuming they exist back-to-back
- Added better error handling
Last edited by SamusAranX,