Skip to content

Hydra0xetc/UnityAudioConverter

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

2 Commits
 
 
 
 
 
 

Repository files navigation

Unity Audio Converter

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.

Features

  • 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).

Requirements

Python Libraries

Install the required Python libraries using pip:

pip install UnityPy fsb5

External Tools

This script relies on ffmpeg for audio conversion. Make sure ffmpeg is installed and accessible in your system's PATH.

Usage

Run the script from your terminal:

python Unity_Converter.py -i <input_unityfs_file> -o <output_directory>

Arguments

  • -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 (.).

Interactive Prompts

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 n to keep OGG files and skip WAV conversion.
  • "Do you want to convert ALL WAV files to MP3? (y/n) [n]:"
    • Enter y to convert all generated WAV files to MP3.
    • Enter n (default) to skip MP3 conversion.
  • "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 n to keep both WAV and MP3 files.

Example

python Unity_Converter.py -i UnityFS_file/Asset_Bundle -o extracted_audio

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages