Download
BHB stands for Bar Hbr Bankshares. Free Porn and XXX sex videos on the Porn paradise Cumlouder: sex and pussy videos to download or to watch on streaming. The hottest pornstars and MILFs with Big Tits. Description The San Andreas Audio Toolkit (SAAT) is a set of commandline tools useful for modding the PC version of the video game Grand Theft Auto: San Andreas. SAAT allows the importing of Ogg Vorbis files into SA audio streams and the importing of WAVe files. Apple articles, stories, news and information.
- 2021-02-17: Version 0.2.4 - Bugfix for song assembly script - thanks to mvn23 (https://github.com/mvn23)
- 2020-05-29: Version 0.2.3 - Works on the Steam version - thanks to Robert Stone (https://github.com/tlby)
- 2012-06-16: Version 0.2.2 - Added a script for assembling complete songs
- 2012-06-16: Version 0.2.1 - Fix build failure on modern Ubuntu
- 2008-07-20: Version 0.2 - Uses GNU Autotools, should build on Windows
- 2005-08-13: Version 0.1.1 - minor metadata fix
- 2005-08-12: Version 0.1 - first release
What does it do?
Radio Free San Andreas extracts all audio from a PC DVD of GrandTheft Auto: San Andreas. This includes all music, DJ chatter, ads,background sounds and cutscenes.
What do I need?
- A GTA: San Andreas DVD, naturally. Developed for the PC version, PS2 does not work, and XBox is untested.
- OpenSSL and libvorbis.
- 1,2GB free hard drive space and ~150MB free physical RAM.
- A little-endian, at least 32-bit CPU.
- A C and a C++ compiler.
How do I use it?
First, compile it. You need GCC, libvorbis and OpenSSL. Run:
- ./configure && make
Then, use it. If you just want to dump everything, try somethinglike:
- mkdir ~/GTA-SA
- mount /mnt/dvd
- src/extract /mnt/dvd/audio/streams/* ~/GTA-SA/ ./metadata.conf
The first arguments are the files to extract from. Then comes thebase directory to put the output files in, and lastly the file to readmetadata from. (getopt(3)? Wazzat?)
The files are extracted as they are stored, to allow you maximumflexibility in processing them. However, this means that you cannotlisten to the songs immediately, since each song is cut up into threepieces (intro, main, and outro) with several alternatives for introand outro with or without DJ chatter over the music. To assemble allsongs without DJ chatter, run the provided shell scriptassemble-songs.sh, giving it the directory you put all the outputfiles in as an argument:
- ./assemble-songs.sh ~/GTA-SA/
Here's the list of files on the PC DVD and the radio station in each:
Filename | Station |
---|---|
audio/streams/aa | Police |
audio/streams/adverts | Adverts |
audio/streams/ambience | Ambience |
audio/streams/beats | Beats |
audio/streams/ch | Playback FM |
audio/streams/co | KROSE |
audio/streams/cr | K-DST |
audio/streams/cutscene | Cutscene |
audio/streams/ds | Bounce FM |
audio/streams/hc | SFUR |
audio/streams/mh | Radio Los Santos |
audio/streams/mr | Radio X |
audio/streams/nj | CSR |
audio/streams/re | K-JAH |
audio/streams/rg | Master Sounds |
audio/streams/tk | WCTR |
Why would I want it?
Because you don't want to pay extra for the soudtrack CD:s when youalready have the game DVD. Because San AndreasRadio is way too specialized to work for you. Because GTA SA Music Extractordoesn't extract anything but the music. Because neither of those toolsare free (as in speech, not as in beer). Because you want a tool thatyou can modify until it does exactly what you want.
Who's to blame?
- Simon Elén reverse engineered the encryption.
- Karl-Johan Karlsson wrote the code.
- The metadata is mostly taken from San Andreas Radio.
Can I change the tagging format?
Sure. The file metadata.conf contains artist and titleinformation for all the tracks in the game. Just change it with a texteditor.
Where do I get it?
The official distribution page is at http://www.lysator.liu.se/~creideiki/radio-free-san-andreas/.
Development takes placeonGitHub.
You suck. I can do this much better.
Patches are welcome attheGitHub project.
San Andreas uses a hierarchical system for managing sound effects, as opposed to the flat arrays of effects used in previous titles. Instead of individual sounds, SA has packages which group sounds based on where they are used in the game, and these sounds are further separated into banks based on what they are used for, with each bank containing up to 400 sounds.
The bank/package system allows the game to only load the sound(s) needed at the moment – in some instances, the game only loads a single sound from a bank (though it is more common for entire banks to be loaded at a time).
Gta San Andreas Audio Files
- 1File formats
- 1.3Packages
File formats
.dat
files are SFX config files. They describe the layout of the audio effects system in terms of packages, banks and individual sounds. They are stored in the audio/CONFIG
directory. All .dat
files have names with 8 characters (minus the extension).
PakFiles.dat
PakFiles.dat
('Package Files') is a list of package names. Each name takes up 52 bytes.
The package name is always null-terminated, and in the stock files the name is padded up to 12 bytes with 0xCD
values. The rest of the 52 bytes are zeros. The game works in exactly the same way without the 0xCD
bytes, but their presence may indicate that PakFiles.dat
is actually a dumped array of 52-byte structures rather than an array of strings.
The package names are the same as their file names inside the audio/SFX
directory. In other files and also in the game, each package is referred to by its 0-based index in the package list (0, 1, 2, etc.).
BankLkup.dat
BankLkup.dat
('Bank Lookup') contains an array of metadata structures for all banks in all packages.
Note that the game uses hardcoded indices to reference specific banks, so changes in order can lead to problems.
The BankSize
field must be updated if the size of the bank changes, especially if the size increases, because the game works out the length of each sound the same way as the calculateBufferSize
function displayed below. If BankSize
is too big, the game will read too far on the last sound, which often causes a segmentation fault.
Packages
Package files contain banks, which contain sound data (including the raw PCM data). Packages are in the audio/SFX
directory and have no file extension.
An unmodified game has the following packages:
FEET
GENRL
PAIN_A
SCRIPT
SPC_EA
SPC_FA
SPC_GA
SPC_NA
SPC_PA
Each bank stored in a package file has two parts: the header and the PCM buffers. The PCM buffers follow the header.
Gta San Andreas Audio Streams Aa File System
Sound structure
Most of the bank header is made up of sound metadata, which has the following structure:
The Headroom
value tells the game how loud the sound will be. This allows the game to adjust what volume to play the sound at in order to prevent the audio clipping. A value of 0 tells the game that the sound is about average volume, with negative values meaning the sound is quieter and positive values meaning it's louder.
LoopOffset
is the position of the start of the looped part of the sound, measured in samples. This value is used to give looped sounds an 'introduction' – for example, the sound of a car's engine starting up should have an unlooped ignition sound, but the sound of the engine running after starting should be looped. If LoopOffset
is -1
, the sound does not loop.
Bank structure
The actual bank header structure is as follows:
The BankHeader
structure's location is specified by the BankHeaderOffset
value of the bank's BankMeta
structure. The maximum number of sounds in each bank is 400.
The audio sample buffers are all in signed 16-bit mono PCM format. This is the same format as in previous titles, with the only difference between SA and GTA 2/III/VC's sound systems being that SA stores just the PCM data along with a SoundMeta
structure rather than storing a full WAV file. The SoundMeta
structure contains enough data to construct .wav
files but at less of a storage cost than the actual WAV header format, allowing more sounds to be used in the game.
The offset of a sound's PCM buffer can be calculated with the following function:
Since the SoundMeta
structure does not specify the size of the buffer, it must be calculated.In the following code, bankAudioSize
is BankMeta.BankSize
for the current bank.
BankSlot.dat
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.
The BankSlot.dat
file's structure is
where Slot
is
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.
Mobile
The mobile version of GTA: San Andreas replaces the previous raw sound storage system with .osw
and .osw.idx
files. An .osw
file is actually an uncompressed ZIP file, and can be opened with most ZIP viewers/extractors. The .osw.idx
file stores a table of contents for the entries in the .osw
file with the same name.
All the game's sounds are present inside the .osw
files in MP3 format. This compression allows all of the .osw
files containing sound effects to take up just 731MB on the mobile version, while the combined size of the SFX files in the PC version is 2.3GB. It may be worth noting that the .osw
files themselves do not contribute to this decreased size because they are not compressed.
The index files begin with the number of entries:
The rest of the file is made up of the same repeated structure:
However, as the length of the file name is dynamic, the structure cannot be read from a buffer directly and code similar to the following must instead be used to read an entry structure:
The BankLkup.dat
, BankSlot.dat
and PakFiles.dat
files are present on mobile and are identical to the PC versions.
Scripting
Sounds can be used in SCM with the following opcodes:
Then, use it. If you just want to dump everything, try somethinglike:
- mkdir ~/GTA-SA
- mount /mnt/dvd
- src/extract /mnt/dvd/audio/streams/* ~/GTA-SA/ ./metadata.conf
The first arguments are the files to extract from. Then comes thebase directory to put the output files in, and lastly the file to readmetadata from. (getopt(3)? Wazzat?)
The files are extracted as they are stored, to allow you maximumflexibility in processing them. However, this means that you cannotlisten to the songs immediately, since each song is cut up into threepieces (intro, main, and outro) with several alternatives for introand outro with or without DJ chatter over the music. To assemble allsongs without DJ chatter, run the provided shell scriptassemble-songs.sh, giving it the directory you put all the outputfiles in as an argument:
- ./assemble-songs.sh ~/GTA-SA/
Here's the list of files on the PC DVD and the radio station in each:
Filename | Station |
---|---|
audio/streams/aa | Police |
audio/streams/adverts | Adverts |
audio/streams/ambience | Ambience |
audio/streams/beats | Beats |
audio/streams/ch | Playback FM |
audio/streams/co | KROSE |
audio/streams/cr | K-DST |
audio/streams/cutscene | Cutscene |
audio/streams/ds | Bounce FM |
audio/streams/hc | SFUR |
audio/streams/mh | Radio Los Santos |
audio/streams/mr | Radio X |
audio/streams/nj | CSR |
audio/streams/re | K-JAH |
audio/streams/rg | Master Sounds |
audio/streams/tk | WCTR |
Why would I want it?
Because you don't want to pay extra for the soudtrack CD:s when youalready have the game DVD. Because San AndreasRadio is way too specialized to work for you. Because GTA SA Music Extractordoesn't extract anything but the music. Because neither of those toolsare free (as in speech, not as in beer). Because you want a tool thatyou can modify until it does exactly what you want.
Who's to blame?
- Simon Elén reverse engineered the encryption.
- Karl-Johan Karlsson wrote the code.
- The metadata is mostly taken from San Andreas Radio.
Can I change the tagging format?
Sure. The file metadata.conf contains artist and titleinformation for all the tracks in the game. Just change it with a texteditor.
Where do I get it?
The official distribution page is at http://www.lysator.liu.se/~creideiki/radio-free-san-andreas/.
Development takes placeonGitHub.
You suck. I can do this much better.
Patches are welcome attheGitHub project.
San Andreas uses a hierarchical system for managing sound effects, as opposed to the flat arrays of effects used in previous titles. Instead of individual sounds, SA has packages which group sounds based on where they are used in the game, and these sounds are further separated into banks based on what they are used for, with each bank containing up to 400 sounds.
The bank/package system allows the game to only load the sound(s) needed at the moment – in some instances, the game only loads a single sound from a bank (though it is more common for entire banks to be loaded at a time).
Gta San Andreas Audio Files
- 1File formats
- 1.3Packages
File formats
.dat
files are SFX config files. They describe the layout of the audio effects system in terms of packages, banks and individual sounds. They are stored in the audio/CONFIG
directory. All .dat
files have names with 8 characters (minus the extension).
PakFiles.dat
PakFiles.dat
('Package Files') is a list of package names. Each name takes up 52 bytes.
The package name is always null-terminated, and in the stock files the name is padded up to 12 bytes with 0xCD
values. The rest of the 52 bytes are zeros. The game works in exactly the same way without the 0xCD
bytes, but their presence may indicate that PakFiles.dat
is actually a dumped array of 52-byte structures rather than an array of strings.
The package names are the same as their file names inside the audio/SFX
directory. In other files and also in the game, each package is referred to by its 0-based index in the package list (0, 1, 2, etc.).
BankLkup.dat
BankLkup.dat
('Bank Lookup') contains an array of metadata structures for all banks in all packages.
Note that the game uses hardcoded indices to reference specific banks, so changes in order can lead to problems.
The BankSize
field must be updated if the size of the bank changes, especially if the size increases, because the game works out the length of each sound the same way as the calculateBufferSize
function displayed below. If BankSize
is too big, the game will read too far on the last sound, which often causes a segmentation fault.
Packages
Package files contain banks, which contain sound data (including the raw PCM data). Packages are in the audio/SFX
directory and have no file extension.
An unmodified game has the following packages:
FEET
GENRL
PAIN_A
SCRIPT
SPC_EA
SPC_FA
SPC_GA
SPC_NA
SPC_PA
Each bank stored in a package file has two parts: the header and the PCM buffers. The PCM buffers follow the header.
Gta San Andreas Audio Streams Aa File System
Sound structure
Most of the bank header is made up of sound metadata, which has the following structure:
The Headroom
value tells the game how loud the sound will be. This allows the game to adjust what volume to play the sound at in order to prevent the audio clipping. A value of 0 tells the game that the sound is about average volume, with negative values meaning the sound is quieter and positive values meaning it's louder.
LoopOffset
is the position of the start of the looped part of the sound, measured in samples. This value is used to give looped sounds an 'introduction' – for example, the sound of a car's engine starting up should have an unlooped ignition sound, but the sound of the engine running after starting should be looped. If LoopOffset
is -1
, the sound does not loop.
Bank structure
The actual bank header structure is as follows:
The BankHeader
structure's location is specified by the BankHeaderOffset
value of the bank's BankMeta
structure. The maximum number of sounds in each bank is 400.
The audio sample buffers are all in signed 16-bit mono PCM format. This is the same format as in previous titles, with the only difference between SA and GTA 2/III/VC's sound systems being that SA stores just the PCM data along with a SoundMeta
structure rather than storing a full WAV file. The SoundMeta
structure contains enough data to construct .wav
files but at less of a storage cost than the actual WAV header format, allowing more sounds to be used in the game.
The offset of a sound's PCM buffer can be calculated with the following function:
Since the SoundMeta
structure does not specify the size of the buffer, it must be calculated.In the following code, bankAudioSize
is BankMeta.BankSize
for the current bank.
BankSlot.dat
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.
The BankSlot.dat
file's structure is
where Slot
is
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.
Mobile
The mobile version of GTA: San Andreas replaces the previous raw sound storage system with .osw
and .osw.idx
files. An .osw
file is actually an uncompressed ZIP file, and can be opened with most ZIP viewers/extractors. The .osw.idx
file stores a table of contents for the entries in the .osw
file with the same name.
All the game's sounds are present inside the .osw
files in MP3 format. This compression allows all of the .osw
files containing sound effects to take up just 731MB on the mobile version, while the combined size of the SFX files in the PC version is 2.3GB. It may be worth noting that the .osw
files themselves do not contribute to this decreased size because they are not compressed.
The index files begin with the number of entries:
The rest of the file is made up of the same repeated structure:
However, as the length of the file name is dynamic, the structure cannot be read from a buffer directly and code similar to the following must instead be used to read an entry structure:
The BankLkup.dat
, BankSlot.dat
and PakFiles.dat
files are present on mobile and are identical to the PC versions.
Scripting
Sounds can be used in SCM with the following opcodes:
- 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 an audio event
- 097B – Plays an audio event in an object
- 09F1 – Plays an audio event in a character
- 09F7 – Plays an audio event in a vehicle
- 09D6 – Makes a character say a scripted speech
Tools
- 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.
See also
- Audio Streams – Used for streaming audio tracks
External links
Grand Theft Auto: San Andreas | |
---|---|
File Formats | .b • .col • .cfg • .cut • .dff • .dat • .fxp • .gxt • .ide • .ifp • .img • .ipl • nodes*.dat • .ped • .rep • .rrr • .scm • .set • .txd |
Documentation | Audio • Cryptography • Cutscenes • Game memory • Handling.cfg • Map Listing • Mission Packs • Instructions • Paths • Replays • Saves • Scripts • Sound Effects • Statistics • Vehicles • Wanted levels |
Tools | CLEO • Collision File Editor II • ENBSeries • G-Tools • IMG Tool • Limit Adjuster • Map Editor • Mod Loader • San Andreas Audio Toolkit • Sanny Builder • TXD Workshop • Magic.TXD |
Tutorials | San Andreas v2.0 Modding • How to create a mission • How to create a script • How to use Map Editor • Vehicle Mod Installation |
Modifications | Design Your Own Mission • Gostown Paradise • GTA: United • Myriad Islands |
Multiplayer | gtaTournament • Multi Theft Auto • San Andreas Multiplayer • (more...) |
Useful links | Community Portal • Discussion Forums • Modding Forums • Mods on GTAGarage.com • Mobile Modding • Opcodes Database |