WwiseConsole class provides a Python interface to Wwise’s command-line tools for converting WAV files to WEM format, which is required for creating custom audio mods.
WwiseConsole
Constructor
Path to Wwise installation directory. If None, uses
tools/wwise/.Path to Wwise project (.wproj). If None, uses bundled
WAVtoWEM project.- Auto-detects Wine on Linux/Flatpak systems
- Ensures project structure exists
- Creates required directories if missing
Methods
is_installed
Checks if Wwise is properly installed.True if WwiseConsole.exe exists (and Wine available on Linux).
convert_to_wem
Converts a single WAV file to WEM format.Path to input WAV file.
Output directory. If None, uses same directory as input file.
Path to the converted WEM file.
RuntimeError: If conversion fails or WEM file not created
- Creates temporary
.wsourcesfile - Runs WwiseConsole with
convert-external-sourcecommand - Cleans up temporary files after conversion
- Searches for WEM in subdirectories if not found in output_dir
batch_convert_to_wem
Converts multiple WAV files to WEM format efficiently.List of WAV file paths to convert.
Output directory for WEM files.
List of successfully converted WEM file paths.
- All WAV files must be in the same directory for batch mode
- If in different directories, converts individually
- Falls back to individual conversion on batch failure
- More efficient than multiple single conversions
Wwise Project Structure
The wrapper uses a minimal Wwise project:- Profile: “Vorbis Quality High”
- Matches game’s audio codec
Installation Paths
Windows
Linux (via Wine)
- Uses
wine64orwinefrom system PATH - In Flatpak: Uses
flatpak-spawn --host wine64
Project Resources
Example Usage
Convert Single WAV
Batch Convert WAVs
Custom Wwise Installation
Command-Line Usage
Convert Single File
Convert Directory
.wsources File Format
The wrapper generates.wsources XML files for Wwise:
WAV Requirements
Recommended Specifications:- Sample Rate: 48000 Hz
- Bit Depth: 16-bit PCM
- Channels: 1 (mono) or 2 (stereo)
- Format: WAV (RIFF)
Wwise Installation
Windows
- Download Wwise from ZZAR Settings page
- Extract to
tools/wwise/ - Verify:
tools/wwise/WWIse/Authoring/x64/Release/bin/WwiseConsole.exeexists
Linux
- Install Wine:
sudo pacman -S wine(Arch) orsudo apt install wine(Ubuntu) - Download Wwise for Windows
- Extract to
tools/wwise/ - Verify Wine:
wine64 --version
Flatpak
- Install Wine on host system (not inside Flatpak)
- Wwise will run via
flatpak-spawn --host wine64
Troubleshooting
WEM Not Created
Check:- Project structure exists (auto-created by wrapper)
- WAV file is valid and not corrupted
- Sufficient disk space
- WwiseConsole output for errors
Wine Issues (Linux)
Check Wine installation:Permission Errors
Performance Notes
Single Conversion:- ~0.5-2 seconds per file
- Wwise startup overhead per conversion
- ~0.1-0.5 seconds per file (after startup)
- Shares Wwise instance across conversions
- Much faster for multiple files
batch_convert_to_wem() for 3+ files.
Technical Details
WwiseConsole Command
Artifact Cleanup
Automatically removes after conversion:list.wsourcesfileWindows/subdirectory (Wwise temp files)
Project Migration
If project is from older Wwise version:Notes
- WEM format uses Ogg Vorbis codec internally
- Conversion is lossy (like MP3)
- Original WAV quality matters - use high quality sources
- Wwise is required for WEM creation (no open-source alternative)
- License: Wwise is free for non-commercial use
- Project template is minimal and portable