The Forum is up for sale: XeNTaX Forum looking for new owner

Metal Gear Solid 3 Audio Format (Yes, Audio Format, not DAT)

Get help on any and all audio formats, or chip in and help others!
pietastesgood
advanced
Posts: 72
Joined: Sun Oct 26, 2008 2:41 am
Has thanked: 3 times
Been thanked: 4 times

Metal Gear Solid 3 Audio Format (Yes, Audio Format, not DAT)

Post by pietastesgood »

Hello, I have a question about the MGS3 music files. I have asked a couple people here but they have not yet had time to look at the files, therefore I thought I would just throw this out to the community to examine.

I have found a program that lets me extract the music files from Metal Gear Solid 3: Subsistance (PS2). It extracts the music perfectly, the problem is, it does not convert it. The extension is .raw, however it definitely isn't the .raw that's compatible with Winamp, it is not recognized by Goldwave either.

Here is the one of the music files that I extracted:

Code: Select all

http://www.megaupload.com/?d=HNW8NLHP
Here is the DAT extractor.

Code: Select all

http://www.mediafire.com/?epwmyxtjtzd
Looking into a hex editor, I see the header is comprised of an odd string, MTA. Then there are quite a few 0000's, some more odd strings, etc, until you get to the real audio data at around 00000FE4.

Deeper into the stream structure, there seems to be no 0000 strings. I am certain it is stereo music, so it cannot be ADPCM like other PS2 games.

I have Googled around, and suspect this may be a format called Konami Wave, or some sort, but I haven't found a converter.

It doesn't seem to be PCM, Goldwave just reads it as static.

It seems to be some sort of proprietary PCM file, it's a PCM file's size, and I am nearly sure it is stereo. The track above I suspect is a smaller, stinger track or some sort. There are larger ones too.

I have tried opening the BGM file with Solidus to no avail.

If you can help me, I will be endlessly grateful. I can supply more audio files as well.

Thank you endlessly in advance! :)
User avatar
lionheartuk
double-veteran
double-veteran
Posts: 749
Joined: Tue May 16, 2006 10:55 pm
Location: Everywhere
Has thanked: 34 times
Been thanked: 42 times

Re: Metal Gear Solid 3 Audio Format (Yes, Audio Format, not DAT)

Post by lionheartuk »

Ive looked at these before but i couldnt make much of it either, SOLIDUS is able to partially open the MGS3 stage.DAT header revealing some file names and whatnot but thats it.

Try using STUNS (Stupid uncompressor) on the files, if you dont have it then i could probably upload it for you as its tiny anyways.Its not MINE though I got it from Turfster and i think he got it from somewhere else too.
pietastesgood
advanced
Posts: 72
Joined: Sun Oct 26, 2008 2:41 am
Has thanked: 3 times
Been thanked: 4 times

Re: Metal Gear Solid 3 Audio Format (Yes, Audio Format, not DAT)

Post by pietastesgood »

Thanks for replying, can you please send me this tool?
User avatar
lionheartuk
double-veteran
double-veteran
Posts: 749
Joined: Tue May 16, 2006 10:55 pm
Location: Everywhere
Has thanked: 34 times
Been thanked: 42 times

Re: Metal Gear Solid 3 Audio Format (Yes, Audio Format, not DAT)

Post by lionheartuk »

here you go, It took me a few hours of scounging through an unforseen number of problems to finally find it again (i dont remember ever deleting it to be honest though...).


Its a pretty simple program but if you get stuck give me a shout.
You do not have the required permissions to view the files attached to this post.
pietastesgood
advanced
Posts: 72
Joined: Sun Oct 26, 2008 2:41 am
Has thanked: 3 times
Been thanked: 4 times

Re: Metal Gear Solid 3 Audio Format (Yes, Audio Format, not DAT)

Post by pietastesgood »

Alrighty, thanks I'll try it out. :D
Waninkoko
ultra-n00b
Posts: 2
Joined: Tue Dec 22, 2009 3:24 pm

Re: Metal Gear Solid 3 Audio Format (Yes, Audio Format, not DAT)

Post by Waninkoko »

I'm investigating too about these files but at the moment there's no luck :(


Also, I unpacked VOX.DAT file using the "Konami DAT Tool" (phew, I didn't have to code my own unpacker :D) and I noticed there are two different audio formats: VAG1 and VAG2.

VAG1 plays fine with MFAudio (most files are mono and 22050Hz) but VAG2 doesn't play correctly (it plays but with some kind of weird effect). Any ideas about VAG2? :/
hcs
mega-veteran
mega-veteran
Posts: 263
Joined: Sun Oct 18, 2009 9:41 pm
Location: Portland, OR
Has thanked: 3 times
Been thanked: 79 times
Contact:

Re: Metal Gear Solid 3 Audio Format (Yes, Audio Format, not DAT)

Post by hcs »

Waninkoko wrote:VAG1 plays fine with MFAudio (most files are mono and 22050Hz) but VAG2 doesn't play correctly (it plays but with some kind of weird effect). Any ideas about VAG2? :/
Have you tried stereo with an interleave of 16 (or 10, I think MFAudio uses hex). The "weird effect" might be that tight interleave.

I'm fairly sure that whatever the raw is is 4-bit oriented, but haven't pinned it down yet.
Waninkoko
ultra-n00b
Posts: 2
Joined: Tue Dec 22, 2009 3:24 pm

Re: Metal Gear Solid 3 Audio Format (Yes, Audio Format, not DAT)

Post by Waninkoko »

hcs wrote:
Waninkoko wrote:VAG1 plays fine with MFAudio (most files are mono and 22050Hz) but VAG2 doesn't play correctly (it plays but with some kind of weird effect). Any ideas about VAG2? :/
Have you tried stereo with an interleave of 16 (or 10, I think MFAudio uses hex). The "weird effect" might be that tight interleave.

I'm fairly sure that whatever the raw is is 4-bit oriented, but haven't pinned it down yet.
Yeah but it doesn't fix the problem.

I opened the VAG2 file with an hex editor and I checked its frequency is 44100Hz (0xAC44). I did the following tests with MFaudio;

Frequency: 44100Hz
Channels: 2
Interleave: 10 (or 20)

Result: Doesn't sound properly


Frequency: 44100Hz
Channels: 2
Interleave: 1000

Result: Sounds OK but with that effect


Frequency: 44100Hz
Channels: 1

Result: Sounds OK, similar to the previous test, but with the weird effect too.
AlphaTwentyThree
double-veteran
double-veteran
Posts: 982
Joined: Mon Aug 24, 2009 10:55 pm
Has thanked: 76 times
Been thanked: 659 times

Re: Metal Gear Solid 3 Audio Format (Yes, Audio Format, not DAT)

Post by AlphaTwentyThree »

Could you upload two or three of these VAG2 files? I'd like to take a look. :) Maybe it's a format that I've encountered lately.
If you like what you see, why not click the little Thank You button? ;) It will definitely motivate me! :)
And here's Mr.Mouse's Facebook link: http://www.facebook.com/permalink.php?s ... 8469022795 - thanks ;)
tytansvx
ultra-n00b
Posts: 2
Joined: Sat Jun 12, 2010 12:54 am

Re: Metal Gear Solid 3 Audio Format (Yes, Audio Format, not DAT)

Post by tytansvx »

Has any one found out how to decode/convert the PCM files from the BGM.DAT file?
User avatar
lionheartuk
double-veteran
double-veteran
Posts: 749
Joined: Tue May 16, 2006 10:55 pm
Location: Everywhere
Has thanked: 34 times
Been thanked: 42 times

Re: Metal Gear Solid 3 Audio Format (Yes, Audio Format, not DAT)

Post by lionheartuk »

The Audio.dat I get due to the SFX etc, But the game has a soundtrack, all the BGM is on there.
Did you try using STUNS on it to see what it throws out?
tytansvx
ultra-n00b
Posts: 2
Joined: Sat Jun 12, 2010 12:54 am

Re: Metal Gear Solid 3 Audio Format (Yes, Audio Format, not DAT)

Post by tytansvx »

MFaudio, eufony for BGM and other PCM decoders but none work.
jhonsadins
ultra-n00b
Posts: 6
Joined: Fri Jul 02, 2010 2:09 pm

Re: Metal Gear Solid 3 Audio Format (Yes, Audio Format, not DAT)

Post by jhonsadins »

Metal Gear Solid 3: Snake Eater manages to set a fantastic pace early on and keeps everything going right up to the closing credits and then some. Overall, this is the best Metal Gear Solid game that we've seen and, yes, it rules.
AlphaTwentyThree
double-veteran
double-veteran
Posts: 982
Joined: Mon Aug 24, 2009 10:55 pm
Has thanked: 76 times
Been thanked: 659 times

Re: Metal Gear Solid 3 Audio Format (Yes, Audio Format, not DAT)

Post by AlphaTwentyThree »

tytansvx wrote:Has any one found out how to decode/convert the PCM files from the BGM.DAT file?
I've taken a look at these files and I haven't seen anything similar before. I can surely say that because that MGS3 format is really noticeable with the 0x330-byte-sized blocks and the 0x80-fillers. I've scoured the net a bit but couldn't find any information about the format. Maybe it's interpretable when it's parsed (i.e. the fillers deleted).
If you like what you see, why not click the little Thank You button? ;) It will definitely motivate me! :)
And here's Mr.Mouse's Facebook link: http://www.facebook.com/permalink.php?s ... 8469022795 - thanks ;)
hcs
mega-veteran
mega-veteran
Posts: 263
Joined: Sun Oct 18, 2009 9:41 pm
Location: Portland, OR
Has thanked: 3 times
Been thanked: 79 times
Contact:

Re: Metal Gear Solid 3 Audio Format (Yes, Audio Format, not

Post by hcs »

I've finally had a little luck with this, I think. I just added MTAF support to vgmstream r942, but note that it needs to rip the audio out of DATs with this: http://hcs64.com/files/demux_dat_01.zip

Run like this:
demux_dat BGM.DAT DAT

Second argument is a prefix for the extracted files.
It also works on VOX, MOVIE, and DEMO. I think the demux_dat_be version will work on MGS4, though I don't know what to do with the MTA2 files there yet.

The old DAT extractors took off a few too many bytes per block (particularly the frame count), I think mine may err a bit in the other direction, but at least it provides enough for decoding. VOX uses VAG1, which I believe other stuff handles, vgmstream doesn't work for those yet.

As for the audio, I still haven't been able to locate the exact code, but I've made an approximation that sounds pretty good. It's an IMA-flavor ADPCM with step idx saturated from 0 to 31, and it does hit those limits frequently, but it uses the Yamaha nibble to delta. I've estimated the step size table by minimizing the least-squares difference across each frame, the tool for this is here is anyone wants to mess with it: http://hcs64.com/files/mtaf_00.zip . Needs lapack and blas for the computation.

I'm using .8 fixed point for the computations. After minimizing across BGM.DAT, the average error is 4.6 and range is -27 to 39 per frame (out of 32k).
Post Reply