How to generate voice files by batch

From Creation Kit
Jump to: navigation, search

For a mod with a lot of dialogue it can be a pain to manually create all files in the CK. It may be easier to batch-generate some or all of the required files. Skyrim uses the FUZ format which combines the actual audio recording in XWM format and the LIP file. To generate these files by batch, a couple of tools are required:

LIP Files

LIP files contain the lipsync data and can be generated using the Creation Kit itself.

CreationKit.exe -GenerateLips:YourMod.esm

This will load the specified ESM and generate LIPs for every dialogue line for which there is a loose WAV file under Data/Sound/Voice/YourMod.ESM/

XWM Files

XWM is an audio format that can be generated from WAVs using Microsoft's xWMAEncode from the Direct X SDK (The download is a SFX ZIP-file, xWMAEncode.EXE can be found under Utilities/Bin/x86)

xwmaencode "my_voice_file.wav" "my voice file.xwm"

This will convert the WAV file into a XWM file.

To create XWM files outside a batch file you can use this tool instead:

FUZ Files

FUZ is a container format that combines XWM and LIP it can be created using Agnahim's Voice File extractor.

fuz_extractor -c "my_voice_file.fuz" "my_voice_file.xwm" "my_voice_file.lip"

Will convert the XWM File and the WAV file into FUZ file as used by Skyrim,

Batch generation

With all tools available, all that is left is creating a batch file that will automatically generate all the FUZ files required by your mod.

Save all your WAV files into a sub-folder of Data/Sound/voice that is named like your mod. (e.g. Data/Sound/Voice/YourMod.ESM/)

Copy xwmaencode.exe and fuz_extractor.exe to that folder (or add them to a folder that is in your commandline-path).

Finally create a new text file in that folder, copy/paste in the following code and rename it to "voice-tool.bat"

for /f "delims=\" %%a in ("%cd%") do set mod=%%~nxa
Start /WAIT ..\..\..\..\CreationKit.exe -GenerateLips:%mod%
FOR /R %%a IN (*.wav) DO xwmaencode "%%a" "%%~pa%%~na.xwm"
FOR /R %%a IN (*.xwm) DO fuz_extractor -c "%%~pa%%~na.fuz" "%%a" "%%~pa%%~na.lip"

When you start the batch file, it will first follow the directory structure to find the name of the topmost folder (which is equal to your mod's name) then it uses the Creation Kit to generate the lip files. The next step is to convert every WAV file in the folder to XWM, and finally all LIPs and XWMs in the folder are combined to FUZs.