Professional Documents
Culture Documents
MANUAL
MANUAL
MANUAL
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 music files into SA audio streams and the
importing of WAVe files into SA sfx archives. It will also necessarily
allow exporting from each type of archive into individual files.
Resources
Official Website
Feedback
The main place for discussion and feedback on SAAT is its GTA Forums
thread: [8]http://www.gtaforums.com/index.php?showtopic=225049. You may
also contact the author directly via email at <pdescobar@comcast.net>.
Installation
Windows Binaries
Source
To install from source, unzip the full archive and open a command prompt to
the src directory. Open Makefile in an editor and change the PLATFORM
variable to a value useful for your environment, editing as necessary. Then
simply type 'make' in the source directory to compile. After compilation,
you would follow the instructions for the binary installation above.
Usage
Stream tool
SFX tool
Examples
I. Stream Tool
In order for your sounds to play correctly in the game, they must be in the
proper format. Thus, it will be highly useful to have an audio editor or
conversion program available. There are many such programs, but one of note
is Audacity. I single out Audacity because it is an open source audio
editor and it is one of the tools used to test SAAT. Audacity is available
at [9]http://audacity.sourceforge.net/
Streams
Currently, SAAT will only accept Ogg Vorbis files for stream import. The
bitrate shouldn't matter but the unmodified game uses variable bitrate
files so that would be the preference. The most important thing is that the
Ogg Vorbis files must be in stereo. If you import a mono file, it will play
at double speed resulting in a "chipmunk" effect. If you have a mono file,
make a stereo file out of it by duplicating the original single track for
both the left and right channels before importing.
Sound Effects
SAAT can handle most of the file formats that libsndfile can process. Since
all the original sound effects are mono, 16-bit integer (little endian),
PCM (uncompressed) WAVe files (without headers,) that is the preferred
format. As with the streams, the most important thing is that it is a mono
sound. If you have a stereo sound, you must mix it down to a single channel
before you import it. Otherwise, in the game it will play at half speed.
You should not have to worry about the sample rate as the game uses
whatever rate it is told to use; however, the sample rate of the exported
sound is listed in the import INI file. This will allow you to ensure the
replacement sound uses the same rate if you would like to be extra
cautious.
The following formats have worked in testing and will probably work for
you:
* mono 16-bit PCM WAV (preferred as no internal conversion is necessary)
* mono 8-bit PCM WAV
* mono 4-bit MS ADPCM WAV
* mono 4-bit IMA ADPCM WAV
* mono 16-bit PCM AIFF
* mono 8-bit PCM AIFF
* mono 16-bit PCM AU
* mono 8-bit ULAW AU
The following formats have not worked in testing and should be avoided:
* mono 32-bit float WAV
* mono 32-bit float AIFF
* mono headerless RAW
* stereo anything (see notes above)
One final note, imported sfx files must be less than 10MB. Anything over
that will definitely cause a problem, and sfx files close to that might
cause a problem. Since the largest sound in the unmodified game is
approximately .5 MB this really shouldn't be an issue.
SAAT uses INI files for a variety of purposes. Currently, there are three
main types of INI files: metadata files, stream import files, and sfx
import files. What follows are brief format outlines and useful values for
these.
A. [global] section
1. albumprefix -- The ALBUM tag for each file will be comosed of this
prefix followed by the 'station' name for the stream.
In stream sections the following key strings are useful. Note that
most are of the form "trackX.YYYY"; these are track-specific and
only apply to track 'X'. For example, track5.title is the title
for track 5.
A. [Stream] section
The stream import INI must have a [Stream] section for global
stream-related information. Note the capitalization. In this section,
the following key strings are useful.
0 = AA (Police)
1 = ADVERTS
2 is unused by the game
3 = AMBIENCE
4 = BEATS
5 = CH (Playback)
6 = CO (KROSE)
7 = CR (KDST)
8 = CUTSCENE
9 = DS (Bounce FM)
10 = HC (SFUR)
11 = MH (Radio Los Santos)
12 = MR (Radio X)
13 = NJ (CSR)
14 = RE (KJAH West)
15 = RG (MasterSounds)
16 = TK (WCTR)
B. Track sections
The stream import INI must have a [Track_XXX] section for each track
which will be imported into the stream. The first track will use
section [Track_001], the second [Track_002], etc. Useful key strings:
4. filename -- The name of the sound file which is being imported for
this track. This can be a relative path ("foo.ogg", "..\bar\baz.ogg")
or an absolute local path ("\temp\moo.ogg", "C:\music\my song.ogg").
The filename should not be quoted in any way and embedded spaces
are okay. The INI file will be scanned on import and missing/invalid
filenames will cause an error and the import will be aborted.
A. [Archive] section
The sfx import INI must have an [Archive] section for global
archive-related information. Note the capitalization. In this section,
the following key strings are useful.
1. basename -- currently unused by importer; contains the base filename
of the archive which was exported.
2. lookup_index -- in order to pick out the proper sound from the sfx
archive, the game uses a lookup table called BankLkup.dat; this is
the index of the imported archive within that file. You should only
change this if you really know what you are doing. Note that if
you export from a archive with a nonstandard name, SAAT will warn
and set the lookup_index to -1; in that case you must change it
to a valid value before importing with that INI. In the unmodified
game, the following indices are used for the archives:
0 = FEET
1 = GENRL
2 = PAIN_A
3 = SCRIPT
4 = SPC_EA
5 = SPC_FA
6 = SPC_GA
7 = SPC_NA
8 = SPC_PA
B. Bank sections
In bank sections the following key strings are useful. Note that
most are of the form "sound_YYY.ZZZZ" ; these are specific to an
individual sound effect. For example sound004.filename is the
filename of the fourth sound in the bank.
References
1. http://www.gnu.org/licenses/licenses.html#GPL
2. http://www.lysator.liu.se/~creideiki/radio-free-san-andreas/
3. http://www.xiph.org/downloads/
4. http://www.mega-nerd.com/libsndfile/
5. http://pdescobar.home.comcast.net/gta/saat/SAAT_release_1_10.zip
6. http://www.gtagarage.com/mods/show.php?id=1186
7. http://pdescobar.home.comcast.net/gta/saat/
8. http://www.gtaforums.com/index.php?showtopic=225049
9. http://audacity.sourceforge.net/
10. http://www.mega-nerd.com/libsndfile/