It seems that you're using an outdated browser. Some things may not work as they should (or don't work at all).
We suggest you upgrade newer and better browser like: Chrome, Firefox, Internet Explorer or Opera

×
high rated
Officially released Dex OST is missing a lot of tracks from the game (not sure why, I contacted developers about it).

So I decided to extract the audio from the game. It proved to be a multi-step procedure, but doable after all.

1. The game is using Unity, and it packs its resources in its own binary format. To extract that, I used QuickBMS extractor with special script made for Unity (thanks to @ssokolow for pointing out this tool).

See http://aluigi.altervista.org/quickbms.htm

I downloaded the source from here: http://aluigi.altervista.org/papers/quickbms_src.zip and built on Linux (note, that it has to be built as 32-bit, since it's using 32-bit assembly. Make sure you have multilib support for your gcc and needed 32-bit dependencies installed). See documentation on the above page for more details.

The actual QuickBMS script for Unity is located here: http://aluigi.altervista.org/bms/unity.bms

You need to run it using the compiled quickbms tool, and provide path to the game resources directory (better make a copy of it, to avoid messing it up by mistake).

In Dex it's files from Dex_Data (only files, skip the directories from there, otherwise the tool gets confused).

When extracting, filter out only *.fsb files (use -f *.fsb parameter). fsb are archives used by FMOD library, which contain audio data.

2. Now, when you got a bunch of *.fsb files, you need to extract them to get actual audio. That's not straightforward, since FMOD doesn't store audio as is, but splits it in some way. So you need another tool to reconstruct it.

Luckily I found one: https://github.com/tmiasko/fsb-vorbis-extractor

I also built it from source. Once you have that, you can already extract actual Ogg/Vorbis files from *.fsb blobs. Most of the music would be in files like resources~highrise.fsb (i.e. lowercase names after ~). Most other files are speech. There are a few exceptions, like resources~GSV_action_1.fsb and similar ones, probably due to GSV being an abbreviation. May be you can find more.

UPDATE:

Helper script for automating the extraction: https://gist.github.com/shmerl/ad11145ad4ef018fb2a5133bd5009948
Post edited July 11, 2016 by shmerl
I'm so lost.... how do I even begin? Isn't there a convenient Windows app that does this? I don't even know what to do with that script you created.
avatar
GuyInDogSuit: I'm so lost.... how do I even begin? Isn't there a convenient Windows app that does this? I don't even know what to do with that script you created.
No, there isn't any convenient method (it was made complicated by combination of using Unity and FMOD by the authors). You can run this script for instance on Linux, once you set up / built from source needed tools as described in the post.
Post edited October 19, 2016 by shmerl
avatar
shmerl: No, there isn't any convenient method (it was made complicated by combination of using Unity and FMOD by the authors). You can run this script for instance on Linux, once you set up / built from source needed tools as described in the post.
The QuickBMS app seems to be able do it, but it keeps giving me script errors.
Nevermind, I managed to extract the largest file which has about 2000+ FSB files.

Found a Windows app to extract the FSB files: aezay.dk/aezay/fsbextractor/
Seems to be hit-and-miss, though. Some files just don't play. But it's progress.
Post edited October 24, 2016 by GuyInDogSuit
So I've tried both Ubuntu and Linux Mint. So far this is what I keep getting:

mint extractors # ./gog_dex_extract_music.sh
./gog_dex_extract_music.sh: line 42: /root/bin/extractors/quickbms: Is a directory
./gog_dex_extract_music.sh: line 62: /root/bin/extractors/extractor: Is a directory
mv: cannot stat 'result_ogg/1.sample.ogg': No such file or directory
./gog_dex_extract_music.sh: line 62: /root/bin/extractors/extractor: Is a directory
mv: cannot stat 'result_ogg/1.sample.ogg': No such file or directory

I don't get what I'm supposed to do? Put all these in the /root folder and create the /bin/extractors one?
Do I put the extracted source files there? The Dex_Data folder? What should be the filenames?
avatar
GuyInDogSuit: I don't get what I'm supposed to do? Put all these in the /root folder and create the /bin/extractors one?
Do I put the extracted source files there? The Dex_Data folder? What should be the filenames?
Yes, you need to place tools in needed directories, I mention it in the comment header in the script, see it for more details. You can also override their locations if you placed them elsewhere, as the example there shows.

Also, don't run it as root, it's a bad idea. Use your normal user.
Post edited October 26, 2016 by shmerl
I'm confused, how would I change those directories? I tried but I get the same error.
avatar
GuyInDogSuit: I'm confused, how would I change those directories? I tried but I get the same error.
Let's say your regular user is "baz".

So you created /home/baz/bin/extractors and placed all your tools there. That should work. Let's say you placed them in /home/baz/tmp instead.

Then you can run the script like this (from the place where it's located):

quickbms=/home/baz/tmp/quickbms unity_bms=/home/baz/tmp/unity.bms vorbis_extractor=/home/baz/tmp/extractor ./gog_dex_extract_music.sh <path_to_dex_data_dir>
Post edited October 31, 2016 by shmerl
What Linux distro do you use?
avatar
GuyInDogSuit: What Linux distro do you use?
Debian testing.
avatar
shmerl: Debian testing.
OK, cool, I'll try that one.
Okay... I've gotten the FSB files, and sometimes extraction seems to work (e.g., resources~Intro.fsb successfully extracts into a WAV file that I can then play), but others don't. Even though I can get OGG files from those files (e.g., resources~dowtown.fsb), the OGG files don't want to play, even with the latest filters from xiph.org.

I'm using FSB Extractor (aezay.dk/aezay/fsbextractor/), if that helps. Are there settings I should be using to get the Vorbis files successfully?

(I should mention that I can play other OGG files from other applications just fine in VLC.)
Post edited January 24, 2018 by addams013
avatar
addams013: I'm using FSB Extractor (aezay.dk/aezay/fsbextractor/), if that helps. Are there settings I should be using to get the Vorbis files successfully?
I don't know what that tool does, but it's probably not making normal ogg/vorbis, and you might need to do some reencoding. See my script for tools that I used:

https://gist.github.com/shmerl/ad11145ad4ef018fb2a5133bd5009948

That's the one that does the job right: https://github.com/tmiasko/fsb-vorbis-extractor
Post edited January 25, 2018 by shmerl
Compiling that extractor from source (clipping out the gtest bits, because I couldn't get them to work) and using your bash script seem to work beautifully! Thank you!
Post edited January 25, 2018 by addams013
avatar
addams013: Thank you. I'm attempting to compile that extractor from source, and have installed the boost-devel, ogg-devel, vorbis-devel, glog-devel, and gtest-devel modules, but am running into a problem with gtest. I've installed it, and changed the location of GTEST_ROOT to the installation location (/usr/include/gtest/), but am getting an error: "The source directory /usr/include/gtest does not contain a CMakeLists.txt file." Is there a place where this particular CMakeLists.txt file is supposed to be?
What distro are you doing it on? I'm doing it on Debian testing, and there was no need to set any GTEST_ROOT variable.

That's all I did after installing the packages and cloning the repo (from the repo directory):

mkdir build
cd build
cmake -DCMAKE_BUILD_TYPE=Release ..
make -j$(nproc)
Post edited January 25, 2018 by shmerl