San Andreas introduces a different method of dealing with SFX compared to it's antecessor, now not only sound indices are available but packages and banks.
Packages are a way to organize the SFX data in different files and banks are a way to organize SFX data in one package. Each bank contains up to 200 sounds. Normally the entire bank is loaded at once, but depending on some circumstances the game might load only a single sound from the bank.
The SFX config formats are pure dumps of game structures, and so contains a lot of irrelevant data. They are stored in the
audio/CONFIG directory and have a
This file is used to enumerate SFX Packages, it's structure is just a list of file names.
repeat (any amount) times: char File Name (relative to the
The first named package has the index 0, the second named package the index 1 and so on.
This file is used to enumerate global bank numbers with it's respective SFX Package.
repeat (any amount) times: uint8_t SFX Package index (as specified in PakFiles.dat) uint8_t Unused (padding) uint32_t Bank offset (where this bank header starts on the package file) uint32_t Bank size (the size of this entire bank without the header)
The game uses global indices to lookup for banks internally, so changing the order of the enumeration will cause problems.
Those are the files responsible for storing all the raw sound data. They are at the
audio/SFX directory with no extension.
The file structure is basically many bank headers (at any offset) followed by it's sound buffers. The offset where each bank header is located is specified by the file BankLkup.dat.
uint16_t Number of sounds in this bank (maximum of 200) uint16_t Unused (padding) repeat (400) times: uint32_t Sound buffer offset (relative to the end of this header) uint32_t Loop offset (in samples) uint16_t Sample rate uint16_t Sound headroom
Following this header are the buffer for the sounds in this bank. Each buffer should be in raw Mono PCM 16-bits format.
Even though there is space in the header for 400 sounds, only 200 are allowed.
A bank slot is capable of storing some SFX data, this data can be either one entire bank or one single sound from a bank. There is a total of 45 bank slots.
Each bank slot is used by a specific audio class of the game, for example 10 slots are used for vehicle banks, one slot for the bank of explosions, 4 slots for script speeches (which stores single sounds), and so on.
uint16_t Number of Slots (must be 45) repeat (Number of Slots) times uint32_t Sum of all buffer size before this slot (ignored) uint32_t Buffer size for this slot uint32_t Unknown (related to feet sounds) uint32_t Unknown (related to feet sounds) byte Ignored
Each slot owns a buffer capable of storing some amount of sound data, if this size is lower than the size of the data stored in the slot, sound artifacts will occur in-game.
By default, those buffer sizes are arbitrary values, but it can safely be the size of the highest bank stored in the slot or the size of the highest sound stored in the slot, depending if the slot is used to store a sound or a bank.
- 018C – Plays a sound on a specific location
- 018E – Stops the played sound
- 03CF – Loads a sound
- 03D0 – Checks if sound has been loaded
- 03D1 – Plays the loaded sound
- 03D2 – Checks if the loaded sound has finished
- 097A – Plays a audio event
- 097B – Plays a audio event in an object
- 09F1 – Plays a audio event in a character
- 09F7 – Plays a audio event in a vehicle
- 09D6 – Makes a character say a scripted speech
- San Andreas Audio Toolkit – Allows you to modify SFX Packages – It contains a bug related to bank slots causing sound artifacts
- GTAForums: Mod Loader – Allows you to easily change SFX data and fixes the sound artifacts on big sounds.
- GTAForums: Dynamic SFX – Fixes sound artifacts caused by sounds bigger than the original.
- Audio Streams – Used for streaming audio tracks
- GTA:SA SFX Directory
- Default contents of PakFiles.dat
- Default contents of BankLkup.dat
- Default contents of BankSlot.dat