Difference between revisions of "FF8/FileFormat FMT"

From Final Fantasy Inside
< FF8
Jump to navigation Jump to search
my_wiki>Shard
m (forgot about the rest of the header)
my_wiki>Shard
m (derp, this is hex)
Line 2: Line 2:
  
 
==FMT File Structure==
 
==FMT File Structure==
The FMT is headed by 4 bytes representing the number of sound file headers in the rest of the FMT file, then by a 32 byte header that isn't interesting.
+
The FMT is headed by 4 bytes representing the number of sound file headers in the rest of the FMT file, then by a 36 byte header that isn't interesting.
  
Each sound header (beginning with the first at 0x40) either contains 70 bytes if it represents a valid sound file, or 38 bytes if it's a blank entry (those 38 bytes are all 0x0)
+
Each sound header (beginning with the first at 0x28) either contains 70 bytes if it represents a valid sound file, or 38 bytes if it's a blank entry (those 38 bytes are all 0x0)
  
 
Each sound header representing a valid sound file contains the following structure:
 
Each sound header representing a valid sound file contains the following structure:
Line 13: Line 13:
 
! style="background:rgb(204,204,204)" | Data
 
! style="background:rgb(204,204,204)" | Data
 
|-
 
|-
| 0x0000
+
| 0x00
 
| 4 bytes
 
| 4 bytes
 
| Size of wav file in the dat.
 
| Size of wav file in the dat.
 
|-
 
|-
| 0x0004
+
| 0x04
 
| 4 bytes
 
| 4 bytes
 
| Offset of wav file in the dat.
 
| Offset of wav file in the dat.
 
|-
 
|-
| 0x0008
+
| 0x08
 
| 12 bytes
 
| 12 bytes
 
| Unknown. If first byte is 0, the other 11 are always 0. Probably some kind of looping metadata.
 
| Unknown. If first byte is 0, the other 11 are always 0. Probably some kind of looping metadata.
 
|-
 
|-
| 0x0020
+
| 0x14
 
| 18 bytes
 
| 18 bytes
 
| Microsoft WAVFORMATEX header for the wav file.
 
| Microsoft WAVFORMATEX header for the wav file.
 
|-
 
|-
| 0x0038
+
| 0x26
 
| 2 bytes
 
| 2 bytes
 
| Samples per block
 
| Samples per block
 
|-
 
|-
| 0x0040
+
| 0x22
 
| 2 bytes
 
| 2 bytes
 
| Number of ADPCM coefficients (used for compression, should always be 7).
 
| Number of ADPCM coefficients (used for compression, should always be 7).
 
|-
 
|-
| 0x0042
+
| 0x24
 
| 28 bytes
 
| 28 bytes
 
| Standard Microsoft ADPCMCoefSets.
 
| Standard Microsoft ADPCMCoefSets.
 
|-
 
|-
 
|}
 
|}

Revision as of 23:38, 3 June 2014

Final Fantasy 8's sound effects are stored within two files. The audio.dat contains the actual wav files, compressed as 4-bit ADPCM. The audio.fmt file is a locator for sounds in the dat.

FMT File Structure

The FMT is headed by 4 bytes representing the number of sound file headers in the rest of the FMT file, then by a 36 byte header that isn't interesting.

Each sound header (beginning with the first at 0x28) either contains 70 bytes if it represents a valid sound file, or 38 bytes if it's a blank entry (those 38 bytes are all 0x0)

Each sound header representing a valid sound file contains the following structure:

Offset Size Data
0x00 4 bytes Size of wav file in the dat.
0x04 4 bytes Offset of wav file in the dat.
0x08 12 bytes Unknown. If first byte is 0, the other 11 are always 0. Probably some kind of looping metadata.
0x14 18 bytes Microsoft WAVFORMATEX header for the wav file.
0x26 2 bytes Samples per block
0x22 2 bytes Number of ADPCM coefficients (used for compression, should always be 7).
0x24 28 bytes Standard Microsoft ADPCMCoefSets.