SFX

From GTAMods Wiki
Jump to navigation Jump to search
This article describes format of SFX files prior to San Andreas. For explanation of an SFX file in San Andreas see SFX (SA)

SFX is a file archive of short audio effects used in GTA 2, GTA III, and Vice City. They consist of two file types, .RAW and .SDT, and are typically located in the ..\audio folder in the game directory. Similar to an IMG archive, the .SDT file is a binary file containing the directory and the .RAW contains the archive.

File format

SDT

GTA 2

Each entry in the SDT file is 24 bytes in size:

4b - int - offset of audio file in sfx.raw
4b - int - size of audio file in bytes
4b - int - samples per sec, the speed of audio
4b - int - unknown
4b - int - loop start, where looping would begin relative to audio file's position, 0 for beginning of audio file
4b - int - loop end, where looping would end relative to audio file's position, -1 for end of audio file

GTA III and Vice City (PS2)

Each entry in the SDT file is 12 bytes in size:

4b - int - offset of audio file in sfx.raw
4b - int - size of audio file in bytes
4b - int - samples per sec, the speed of audio

GTA III and Vice City (PC)

Each entry in the SDT file is 20 bytes in size:

4b - int - offset of audio file in sfx.raw
4b - int - size of audio file in bytes
4b - int - samples per sec, the speed of audio
4b - int - loop start, where looping would begin relative to audio file's position, 0 for beginning of audio file
4b - int - loop end, where looping would end relative to audio file's position, -1 for end of audio file

RAW

The RAW file contains raw WAV files. Headers must be added for use in standard audio players when extracted. The following is the standard header in terms of the SDT format.

Offset Type Identifier Description
0x00 char[4] ChunkID "RIFF"
0x04 dword ChunkSize size from SDT format + 36
0x08 char[4] Format "WAVE"
0x0C char[4] Subchunk1ID "fmt "
0x10 dword SubchunkSize 16
0x14 word AudioFormat 1 (PCM)
0x16 word NumChannels 1 (mono)
0x18 dword SampleRate sample rate from SDT format
0x1C dword ByteRate sample rate from SDT format * 2
0x20 word BlockAlign 2
0x22 word BitsPerSample 16
0x24 char[4] Subchunk2ID "data"
0x28 dword Sunchunk2Size size from SDT format
0x2C - Data raw SFX data

SFX files content

GTA III

Vice City

Tools

See also

External links