Mortal Kombat X sound format

Codecs, formats, encoding/decoding of game audio, video and music
n97t7f7b57f
Posts: 27
Joined: Tue Apr 21, 2015 2:15 pm

Re: Mortal Kombat X sound format

Post by n97t7f7b57f »

about SND_*.XXX structure

there are 2(?) types of sound packages:
1. Type 1 - encrypted fsb data stored separately from FSBsize and FSBoffset
XXX header offset 0x65 is offset of FSB1data

Code: Select all

[nametable]
[FEVsize][FEVoffset][FEVdata]
[FSB1size][FSB1offset]
[FSB2size][FSB2offset]
[FSB3size][FSB3offset]
[FSB4size][FSB4offset]
...
[FSB1data]
[FSB2data]
[FSB3data]
[FSB4data]


2. Type 2 - encrypted fsb data stored normaly.
XXX header offset 0x65 is Null

Code: Select all

[nametable]
[FEVsize][FEVoffset][FEVdata]
[FSB1size][FSB1offset][FSB1data]
[FSB2size][FSB2offset][FSB2data]
[FSB3size][FSB3offset][FSB3data]
[FSB4size][FSB4offset][FSB4data]


static location of nametable offset is unknown for me,
so i use some durty code to find it.
SND_uni.bms -

Code: Select all

...
findloc offset string "default"
math offset += 172
...

dont work with SND_MUS_TrainingRoom.xxx and all
foreign language files (i.e. SND_SPEECH_MILEENA_ESP.xxx, SND_SPEECH_SCORPION_GER.xxx etc)

SND_foreign.bms -

Code: Select all

...
findloc SND_ string "SND_"
math SND_ -= 4
goto SND_
get FNsize long
getdstring FNAME FNsize
string FNAME - 4
string FNAME + ".fev"
findloc offset string FNAME
...

dont work with SND_MUS_TrainingRoom.xxx and other default(ENG) language
happyend
Posts: 157
Joined: Sun Aug 24, 2014 8:54 am

Re: Mortal Kombat X sound format

Post by happyend »

n97t7f7b57f wrote:
happyend wrote:Can the script support fev file extract?

Extraction of fmod files (.fev and .fsb)
from decompresed MKX packages(SND_.XXX)

Put your SND_ files in "input" folder
Run "extract_SND.bat"
In "FMOD" folder you will find decrypted fev's and fsb's


GJ~~THX!!!
id-daemon
Posts: 1040
Joined: Sun Mar 22, 2015 7:09 pm

Re: Mortal Kombat X sound format

Post by id-daemon »

n97t7f7b57f wrote:about SND_*.XXX structure

1. Type 1 - encrypted fsb data stored separately from FSBsize and FSBoffset
2. Type 2 - encrypted fsb data stored normaly.


What about unencrypted fsb data? Why didn't you find it?
n97t7f7b57f
Posts: 27
Joined: Tue Apr 21, 2015 2:15 pm

Re: Mortal Kombat X sound format

Post by n97t7f7b57f »

id-daemon2 wrote:What about unencrypted fsb data? Why didn't you find it?

I'm talking about SND_ packages.
There is no unencrypted fsb data.
am i wrong?

CHAR_ packages contain encrypted AND unencrypted fmod files...

But first task for us now is to find an accurate way to nametable offset
Seifer29
Posts: 2
Joined: Sat Apr 25, 2015 2:15 pm

Re: Mortal Kombat X sound format

Post by Seifer29 »

Hey guys, any idea where the combat sounds are located? Stuff like the gibberish that Liu Kang/Raiden say during their special moves. I was able to extract the sounds from the SND_SPEECH_RAIDEN_ENG.xxx for example, but it seems to only contain his intro quotes and none of the fighting sounds.

There is another .xxx file named SND_COMBAT_All.xxx, but it is kind of a smaller file, so I doubt it would contain all the combat sounds for all the different characters, but I could be wrong. When I tried to extract the sounds using id-daemon2's tool, it didn't output anything like it did with the other files. Is it possible that the tools aren't extracting all the sounds from the xxx files and that they might actually be in there? Wish I knew more about this stuff, but I am lucky to get even this far (thanks to you guys).

Thanks in advance.
id-daemon
Posts: 1040
Joined: Sun Mar 22, 2015 7:09 pm

Re: Mortal Kombat X sound format

Post by id-daemon »

n97t7f7b57f wrote:I'm talking about SND_ packages.
There is no unencrypted fsb data.


Ah, ok. I was thinking about CHAR_ packages.

n97t7f7b57f wrote:But first task for us now is to find an accurate way to nametable offset


Ok. First you find all files of type "FmodEventFile" in the package. Then you go to each of them, read the property list in the beginning (this can be variable size, and you have to use package nametable to read it). Then after this you have your nametable.

But i personally don't see any use in .fsb filenames, so you can just find all "DataSourceBank" files and read offsets from there.
id-daemon
Posts: 1040
Joined: Sun Mar 22, 2015 7:09 pm

Re: Mortal Kombat X sound format

Post by id-daemon »

Seifer29 wrote:When I tried to extract the sounds using id-daemon2's tool, it didn't output anything like it did with the other files.


This is because of unknown problem with these .fsb files. There are either some incompatibility, or error in fmod library. I made a workaround for these small files, but it often cuts the end of the sound. No solution for this now.

Have you tried to use "music player ex" for these .fsb files ?
Seifer29
Posts: 2
Joined: Sat Apr 25, 2015 2:15 pm

Re: Mortal Kombat X sound format

Post by Seifer29 »

So I was able to play the sounds from SND_COMBAT_All.xxx using music player ex. It was filled with all the impact sounds (blocking, whooshing, bone-breaking, etc). Didn't have any of the character's battle sounds, though. Hmm, wonder where they are at. I also tried playing the 4 different fsb files from SND_SPEECH_RAIDEN_ENG.xxx using music player ex. It still only played the character intro dialogues, but no combat sounds.

So not really sure if the fight sounds are just located in another xxx file somewhere or if the sounds just aren't being picked up due to the incompatibility/error you mentioned.
n97t7f7b57f
Posts: 27
Joined: Tue Apr 21, 2015 2:15 pm

Re: Mortal Kombat X sound format

Post by n97t7f7b57f »

id-daemon2 wrote:
aluigi wrote:Maybe the size is aligned?
these 32 bytes are added by the engine. This is just an information for those who want to extract them.

these 32 bytes are

Code: Select all

[delimiter Int64][null]
[filesize][filesize][null]
[fileoffset][null]
id-daemon
Posts: 1040
Joined: Sun Mar 22, 2015 7:09 pm

Re: Mortal Kombat X sound format

Post by id-daemon »

n97t7f7b57f wrote:But first task for us now is to find an accurate way to nametable offset


if you need more details on this, i can explain. This is all about the UE packages. That's what gildor's tools do.
n97t7f7b57f
Posts: 27
Joined: Tue Apr 21, 2015 2:15 pm

Re: Mortal Kombat X sound format

Post by n97t7f7b57f »

MKX_FMOD_Extractor beta 0.3
Extraction of fmod(sound) files (.fev and .fsb)
from decompresed MKX packages(.XXX)

Put your decompresed XXX in "input" folder
Run "1_extract_fmod.bat"
In "FMOD" folder you will find decrypted fev's and fsb's

Run "2_extract_wav.bat"
to extract all audio from fsb in wav format

upd. updated fsb_aud_extr.exe
Last edited by n97t7f7b57f on Thu Apr 30, 2015 8:44 pm, edited 2 times in total.
happyend
Posts: 157
Joined: Sun Aug 24, 2014 8:54 am

Re: Mortal Kombat X sound format

Post by happyend »

hi~~n97t7f7b57f
Can the script Adding support DarkestDungeon (.bank) fev+fsb file extract?fev file looks confused?Thanks in advance!!!

Samples:
http://www48.zippyshare.com/v/x3wD3D1s/file.html
Egor705
Posts: 12
Joined: Thu Apr 30, 2015 10:50 am

Re: Mortal Kombat X sound format

Post by Egor705 »

n97t7f7b57f wrote:MKX_FMOD_Extractor beta 0.2
Extraction of fmod(sound) files (.fev and .fsb)
from decompresed MKX packages(.XXX)

Put your decompresed XXX in "input" folder
Run "1_extract_fmod.bat"
In "FMOD" folder you will find decrypted fev's and fsb's

Run "2_extract_wav.bat"
to extract all audio from fsb in wav format


Does it works with CHAR_Scorpion_C (for example) or only with SND_...xxx?
n97t7f7b57f
Posts: 27
Joined: Tue Apr 21, 2015 2:15 pm

Re: Mortal Kombat X sound format

Post by n97t7f7b57f »

Egor705 wrote:Does it works with CHAR_Scorpion_C (for example) or only with SND_...xxx?

tested on CHAR_Jason_A.xxx and char_aztec_a.xxx
should work with any MKX package.

bug repotrs are welcome
interloko
Posts: 7
Joined: Mon Apr 27, 2015 12:21 am

Re: Mortal Kombat X sound format

Post by interloko »

I'm having troubles with most of the characters SFXs
I was able to extract just Baraka, Jax, MasterMale, Rain, Sindel and Tanya

This is what I made:
1- decompress CHAR_character.xxx with decompress.exe by Gildor
2- use your tool
If I use fsb_aud_extr.exe then it "freeze" when try to export the encrypted SFXs fsb. Not really freeze, just run but extract nothing, or extract just 1 or 2 and don't pass to next file.

If I change fsb_aud_extr for fsbext then extracts all but SFX and VO are in ogg format but I can't convert them to wav =/

In the other hand, the few SND_SPEECH_char_language I tried worked great.
id-daemon
Posts: 1040
Joined: Sun Mar 22, 2015 7:09 pm

Re: Mortal Kombat X sound format

Post by id-daemon »

OK, here's temporary workaround for these small sounds which freezes the extractor.

Somehow (i think by error in fmod official library) for MONO files, instead of sound length in bytes it returns twice smaller number, and then hangs when i try to read the sound. So I make it double the size only for mono files. That is wrong, but it works now. 2-,4-,6-channel files extracts without this problem. Suggestions welcome.

p.s. there was no error. See below.
Last edited by id-daemon on Thu Apr 30, 2015 8:00 pm, edited 2 times in total.
interloko
Posts: 7
Joined: Mon Apr 27, 2015 12:21 am

Re: Mortal Kombat X sound format

Post by interloko »

Thanx for the update
Now extract a lot of sounds of the problematic SFXs fsb but crash. I'm not sure if extract them all or not

Edit:
I made a quick test with CHAR_QuanChi_A.xxx
Made a comparission with the number of files (ogg) extracted by fsbext, and using fsb_aud_extr it crash when were extracting a NOT encrypted fsb (7071719.fsb) so not all of the VO sounds were extracted
id-daemon
Posts: 1040
Joined: Sun Mar 22, 2015 7:09 pm

Re: Mortal Kombat X sound format

Post by id-daemon »

interloko wrote:Thanx for the update
Now extract a lot of sounds of the problematic SFXs fsb but crash.


send me the files in pm, i'll check it.
interloko
Posts: 7
Joined: Mon Apr 27, 2015 12:21 am

Re: Mortal Kombat X sound format

Post by interloko »

Just uploaded the problematic file because my internet sucks. Tell me if you need something more
id-daemon
Posts: 1040
Joined: Sun Mar 22, 2015 7:09 pm

Re: Mortal Kombat X sound format

Post by id-daemon »

Ok, problem was when the whole FSB file is marked as stereo, then fmod extracts all individual files as stereo, though they all can actually be mono. The same is probably true for other channel combinations.

So this new version ignores what's written in individual sound properties, and extracts all the files with the channel count given in FSB. At least it works for all files that i have now.

UPDATE: new version uploaded:
viewtopic.php?f=6&t=833&p=5209#p5209
Last edited by id-daemon on Mon May 11, 2015 3:17 pm, edited 2 times in total.