New tool to extract audio from Civ 6

jonwil

Chieftain
Joined
May 1, 2018
Messages
2
I have written a tool to help with extracting audio (e.g. the awesome music) from Civilization 6.
The Windows binary is attached to this post and the source code can be found at https://github.com/jonwil/soundextract
Other than the win32 UI stuff, the rest of the code is all standard C++ (or at least it should be) so it should be possible to make the core code work on Linux or Mac if you want to and you have the programming skills to do so (I dont use Linux or Mac so I wont be doing it). Note also that its only tested on the data files from the Windows version of Civilization 6 (it may not work on the other platform data files since I dont have those).

To use it, start the program and press the "open" button. Under the Civ 6 install folder navigate into base or into one of the folders under DLC and look for a "platforms" folder. Then go into that folder then into "windows" then "audio" (if there is no "audio" folder, that DLC has no audio). Under the "audio" folder (and the language specific folders within that, if they exist) there will be 1 or more xml files. Open one of these.

You will then see a list of all the audio within that particular sound bank (either stored loose as wem files or stored inside the bnk file). Select one and press "extract" and then save it to the location you want. Right now it extracts it as a wem file (to be converted via ww2ogg if its using Vorbis audio or via other tools if its using ADPCM or PCM audio) but I am planning to add proper conversion for all 3 codecs (so my tool will do the same thing as ww2ogg does for example) in a future version.

The advantage of this new tool is that it gives all the audio files within the bank a proper name (no more need to use a bnk extraction tool to extract the sounds embedded in the bank and no more need to try and guess which .wem file (loose or extracted) is the one you want by looking at the xml or txt files, soundextract will take care of giving the sound files a proper name and extracting the data from the bnk file if need be.
 

Attachments

Now soundextract converts the wem file properly to an ogg file or wav file (depending on the codec).
Source code is updated as well.

Much easier way to do this stuff than to try and figure out what wem file you need, use a bank extraction tool to extract it if its in a bank then run ww2ogg/revorb if its using ogg, an adpcm tool if its using adpcm or a pcm tool if its using pcm. Soundextract incorporates the bank extraction tool, ww2ogg, revorb, adpcm stuff and pcm stuff plus automatically giving useful names to the sounds rather than numbers.
 

Attachments

It works perfect with "Sid Meiers Civilization VI Rise and Fall\Base\Platforms\Windows\audio"
but doesn't work at all with the DLCs
 
It works perfect with "Sid Meiers Civilization VI Rise and Fall\Base\Platforms\Windows\audio"
but doesn't work at all with the DLCs

Just as a note, it actually does work with the DLCs, it just has some trouble and won't work "out of the box". But that can be fixed easily. I made the extractor application large address aware, and ran it as an administrator and it works fine now.

The running as admin part is easy, the Large Address Aware patching is easy too, but you need to download a patch (incidentally, it works for any 32-bit application). There are a number of places you can get the LAA patch, but I got mine from https://www.techpowerup.com/forums/threads/large-address-aware.112556/. If you don't trust my link, that's fine too. Like I said, there's actually a number of trustworthy places to get this patch online.

I'm actually not sure which of these two fixes (Admin and LAA) is the necessary one, because after I applied both, and then deleted the extractor .exe, and downloaded a fresh one, it wouldn't break again, even when I try. I'll reboot to flush the RAM and see if that flushes the fixes out shortly and then report back which is the only patch needed (or both).
 
Back
Top Bottom