VOX.DAT (MGS3)

From mgsdevwiki
Jump to: navigation, search

Page discussing the breakdown of files stored in VOX.DAT from MGS3. Contains dialogue files encoded with the VAG (Codec) audio codee (Might be shared with other DAT files in the game).

Format

All data is stored in blocks of maximum 0x4010 bytes, and a minimum size of 0x10. First 0x8 bytes are the "header" of the block.

  • Endianness: Little Endian

Example of a typical block:

01001000 50000000 00000000 00000000
56414731 00000020 00000000 00002780 
00005622 00000000 00000000 00000000 
6D303030 5F303030 5F673030 305F3030 
32002E00 02000000 C278F877 B8F01200

First 0x8 bytes are the header:

01001000 50000000

Breakdown of bytes in the header:

Size Function
0x2 Block Type
0x2 Block Sub-Type
0x4 Block size

Known block types

0x10

Beginning-of-File Block. Always size 0x10. Denotes the beginning of and the type of a file. All subsequent blocks belong to this file, until an End-of-File Block is reached.

Example of a typical BOF block:

10000000 10000000 00000000 01001000

First 0x8 bytes are the header. Breakdown of remaining bytes:

Size Function Values
0x4 Unused 0
0x2 File type 0x1 (Audio), 0x2 (Unknown), 0x4 (Subtitle), 0x5 (Unknown), 0x6 (Unknown), 0x7 (Unknown), 0xE (Video), 0xF (Unknown)
0x2 File codec (If audio) 1 (MTA2), 2 (MTA2), 0x10 (VAG), 0x11 (MTAF)

0xF0

End-of-File Block. Always size 0x10. Marks the end of a file. Generally followed by padding.

0x1

Audio data Block

0x2

Unknown

0x4

Subtitle data Block

0x5

Unknown

0x6

Unknown

0x7

Unknown

0xE

Video data Block

0xF

Unknown

Padding calculation

Every file is followed by padding, calculated by the offset of the end of the file. The formula is as follows:

Padding Offset = (EoF Offset + 0x7ff) / 0x800*0x800

Credits

Adam Gashlin aka hcs64 for demux_dat the analysis of which lead to this guide.