Next Page

Metal Gear Solid 2 PC: Need help trying to extract the contents of BGM.dat by E3245 at 8:38 PM EDT on March 24, 2017
Hello all. I'm trying to extract the contents of BGM.dat of the PC copy of Metal Gear Solid 2 so I can get the loop points of the music, but demux_dat and demux_dat_be does not work with this archive. It keeps saying: unknown block type 700 at 0.

Here's the header of the BGM.dat, the first 288 bytes (The actual file is about 300MBs): BGM.dat header

Thanks in advance
by GirianSeed at 1:46 AM EDT on March 26, 2017
Sorry, I don't know exactly where the loop points are stored, but Turfster's Solidus tool can handle MGS2 PC's bgm.dat. You can select the option "Keep MS ADPCM WAV." That might help.

There doesn't seem to be much to the header. The audio data starts roughly around offset 0x9DF (or maybe a little before at 0x700 if the null data is supposed to be part of it).
by E3245 at 4:55 AM EDT on March 26, 2017
I know that BGM.dat doesn't contain the loop points, but the individual files inside of the archive does. For example, MGS3/4 had *.mtaf/*.mta2 files within their respective BGM.dat archives that contain the audio and the loop points that the game uses. I think I read somewhere that MGS2 PC uses streamed audio, similar to MGS3 and 4, while the PS2 version uses a different format.

Anyways, would it be better just to upload the entire BGM.dat, or if possible, just cut the file up to a certain offset that would be useful to others?

edited 4:56 AM EDT March 26, 2017
by E3245 at 2:55 AM EDT on March 28, 2017
I'm gonna bump this thread with a download link to the entirety of MGS2PC's bgm.dat, if anyone wants to take a crack at opening the contents:

http://www.mediafire.com/file/8jnalws9av1t5wf/bgm.7z
by bnnm at 3:25 PM EDT on March 28, 2017
It's just a bunch of files mashed together.
Each file has a mini header, with sample rate/channels/etc and it has loop points (at 0x0c and 0x10, in total sample values).

I'm having trouble to understand how they are split though (the first value in the header looks like the size in bytes, but it's not exact).
Is there any companion BGM.something file or such?
by GirianSeed at 3:36 PM EDT on March 28, 2017
bnnm: "Is there any companion BGM.something file or such?"

Nope.
by E3245 at 3:39 PM EDT on March 28, 2017
@bnnm

I'm afraid not. That's the only BGM.dat file that the game has, besides the other *.dat files: codec, demo, face, movie, movievr, and vox.
by hcs at 4:41 PM EDT on March 28, 2017
If it's like MGS1, the size near the beginning is the size of the payload. Everything is stored in many blocks per data type. See voxhound for my incomplete work on that. Basically a 4-byte header with the first byte being type, 1 is audio, F0 is end of file. There's a metadata block at the beginning with payload size (actual bytes of audio data within all blocks), codec, etc, don't recall the type.

MGS3 and 4 are similar, see demux_dat.
by bnnm at 5:45 PM EDT on March 28, 2017
The format seems simpler than that and I was able to create some quick GENH so I don't think it's blocked, but I'll check voxhound

A couple of mini-headers:
@ 0x0000000
00079000: size? (real size: 0x79800)
007F: volume?
AC44: sample rate
02: channels (04 are possible too)
001100: ?
000129DD: loop start
00050699: loop end

@ 0x79800:
001B6000: size? (real size: 0x1B48000)
007F: volume?
AC44: sample rate
04: channels
001100: ?
00032911: loop start
000CEB8A: loop end

Et cetera. Data start @ 0x800, codec is MS-ADPCM with 0x800 block size.


At worst it's possible to make a simple script to look for 0x007F 0xAC44 (constant) every 0x800+4 but it's weird.

It does have 4ch MS-ADPCM which I think aren't supported in vgmstream (yet?)
by hcs at 7:17 PM EDT on March 28, 2017
Ok, if it works as MS ADPCM then probably no point in worrying about blocking, unless all of the data is in one huge block?

Next Page
Go to Page 0 1

Search this thread

Show all threads

Reply to this thread:

User Name Tags:

bold: [b]bold[/b]
italics: [i]italics[/i]
emphasis: [em]emphasis[/em]
underline: [u]underline[/u]
small: [small]small[/small]
Link: [url=http://www.google.com]Link[/url]

[img=https://www.hcs64.com/images/mm1.png]
Password
Subject
Message

HCS Forum Index
Halley's Comet Software
forum source