Masquerade
26-02-2022, 14:38
How to properly compress FMOD vorbis audio
Good evening everyone. I will not spend too long writing up this one since I detailed a lot in the WWise guide.
Like I noted in my guide for WWise audio, the WAV version of FMOD can be compressed with MSC just fine. FSB files contain OGG audio or WAV (and in some cases, both). OGGs, when done correctly, can be compressed with Oggre, saving you some space.
Here is the guide for how to properly compress FMOD audio. Part credits go to sowwyitsanalt for helping dig up some of these tools to help with the process.
Guide
Step 1: if you have an FMOD .bank file
Dump the bank to an fsb file using BankDumper (https://www.fileforums.com/showpost.php?p=495874&postcount=57).
BankDumper Master.bank Master.FSB
Step 2: now that you have a file that starts with FSB5 header
Download the attachment from below - "Python-FSB5.7z". This is a modified version of this library (https://github.com/HearthSim/python-fsb5) used to dump FMOD audio into playable OGGs and WAVs. Thanks to anadius for the modifications.
Extract the 7z.
Install Python if you do not have it installed, you will need it to run the script.
Open a command window in the folder containing your bank
Run: extract.py "<fsb file>" -o "<output folder"
extract.py Master.FSB -o Master
Pray that it works. If you get an error message, I would stop using this bank and move on, but it's up to you.
Step 3: Building the big ogg file
Use Bincat (https://aluigi.altervista.org/mytoolz/bincat.zip) by Aluigi to concatenate the oggs in the output folder into a single file. If there are wavs, concatenate them into a separate file.
bincat Master\*.ogg Master.TMP
bincat Master\*.wav Master.TMP2
Step 4: OGG to FMOD
At this point, we are working on our recompression steps. Use oggvorbis2fsb5 (https://github.com/uyjulian/oggvorbis2fsb5) to turn your big ogg file into an FMOD audio file.
oggvorbis2fsb5 Master.TMP Master.DAT
This tool will crash if any non OGG data is in the big file, so this is why we separate our wavs. If you have any wav data, use Bincat to combine the output from oggvorbis2fsb5 with the WAV TMP file you made earlier.
bincat Master.DAT Master.TMP2 Master.FSB_NEW
Step 5: Make a patch to the original bank
Depending on your output from step 4, you will either have a DAT file or a FSB_NEW file. You can now use XDelta or HDiffZ to make a patch from this file to the original bank. See how small it is!
If you use this method for installation, follow step 4 after extracting your archive to build the FMOD compatible data then instead of making the patch, apply the patch you made in step 5 to restore the original file.
https://i.ibb.co/98Wg1bG/Capture.png
Hopefully you now understand the process of compressing FMOD audio.
Referring to the above method, Master.TMP will be able to be compressed with oggre leading to smaller size than if you ran LZMA or whatever over the BANK.
This method is hit and miss, since there can be frequent errors with the python script. It isn't perfect.
If you would like a visual example, with screenshots and demonstration on a sample bank, please let me know and I shall provide.
Good evening everyone. I will not spend too long writing up this one since I detailed a lot in the WWise guide.
Like I noted in my guide for WWise audio, the WAV version of FMOD can be compressed with MSC just fine. FSB files contain OGG audio or WAV (and in some cases, both). OGGs, when done correctly, can be compressed with Oggre, saving you some space.
Here is the guide for how to properly compress FMOD audio. Part credits go to sowwyitsanalt for helping dig up some of these tools to help with the process.
Guide
Step 1: if you have an FMOD .bank file
Dump the bank to an fsb file using BankDumper (https://www.fileforums.com/showpost.php?p=495874&postcount=57).
BankDumper Master.bank Master.FSB
Step 2: now that you have a file that starts with FSB5 header
Download the attachment from below - "Python-FSB5.7z". This is a modified version of this library (https://github.com/HearthSim/python-fsb5) used to dump FMOD audio into playable OGGs and WAVs. Thanks to anadius for the modifications.
Extract the 7z.
Install Python if you do not have it installed, you will need it to run the script.
Open a command window in the folder containing your bank
Run: extract.py "<fsb file>" -o "<output folder"
extract.py Master.FSB -o Master
Pray that it works. If you get an error message, I would stop using this bank and move on, but it's up to you.
Step 3: Building the big ogg file
Use Bincat (https://aluigi.altervista.org/mytoolz/bincat.zip) by Aluigi to concatenate the oggs in the output folder into a single file. If there are wavs, concatenate them into a separate file.
bincat Master\*.ogg Master.TMP
bincat Master\*.wav Master.TMP2
Step 4: OGG to FMOD
At this point, we are working on our recompression steps. Use oggvorbis2fsb5 (https://github.com/uyjulian/oggvorbis2fsb5) to turn your big ogg file into an FMOD audio file.
oggvorbis2fsb5 Master.TMP Master.DAT
This tool will crash if any non OGG data is in the big file, so this is why we separate our wavs. If you have any wav data, use Bincat to combine the output from oggvorbis2fsb5 with the WAV TMP file you made earlier.
bincat Master.DAT Master.TMP2 Master.FSB_NEW
Step 5: Make a patch to the original bank
Depending on your output from step 4, you will either have a DAT file or a FSB_NEW file. You can now use XDelta or HDiffZ to make a patch from this file to the original bank. See how small it is!
If you use this method for installation, follow step 4 after extracting your archive to build the FMOD compatible data then instead of making the patch, apply the patch you made in step 5 to restore the original file.
https://i.ibb.co/98Wg1bG/Capture.png
Hopefully you now understand the process of compressing FMOD audio.
Referring to the above method, Master.TMP will be able to be compressed with oggre leading to smaller size than if you ran LZMA or whatever over the BANK.
This method is hit and miss, since there can be frequent errors with the python script. It isn't perfect.
If you would like a visual example, with screenshots and demonstration on a sample bank, please let me know and I shall provide.