A simple Python script to extract audio from UnityFS (Unity Asset Bundle) files, decode FSB audio, and convert it to WAV and optionally MP3 format.
- Extracts raw audio data from UnityFS files using
UnityPy. - Decodes FSB (FMOD Sound Bank) audio data to OGG format using
fsb5. - Converts OGG audio to WAV format using
ffmpeg. - Optionally converts WAV audio to MP3 format using
ffmpeg. - Provides options to clean up intermediate files (e.g.,
.dat,.ogg,.wav).
Install the required Python libraries using pip:
pip install UnityPy fsb5This script relies on ffmpeg for audio conversion. Make sure ffmpeg is installed and accessible in your system's PATH.
- Download ffmpeg: ffmpeg.org/download.html
- Installation Guide: Follow the instructions for your operating system.
Run the script from your terminal:
python Unity_Converter.py -i <input_unityfs_file> -o <output_directory>-i,--input(required): Path to the UnityFS input file (e.g., a Unity asset bundle).-o,--output(optional): Directory to save the extracted and converted audio files. Defaults to the current directory (.).
The script will prompt you during execution:
- "Do you want to convert OGG files to WAV? (y/n) [y]:"
- Enter
y(default) to convert OGG files to WAV. - Enter
nto keep OGG files and skip WAV conversion.
- Enter
- "Do you want to convert ALL WAV files to MP3? (y/n) [n]:"
- Enter
yto convert all generated WAV files to MP3. - Enter
n(default) to skip MP3 conversion.
- Enter
- "Delete ALL original WAV files after conversion? (y/n) [y]:" (Appears only if MP3 conversion is chosen)
- Enter
y(default) to delete the original WAV files after successful MP3 conversion. - Enter
nto keep both WAV and MP3 files.
- Enter
python Unity_Converter.py -i UnityFS_file/Asset_Bundle -o extracted_audio