Difference between revisions of "SFX"

From GTAMods Wiki
Jump to navigation Jump to search
Line 1: Line 1:
{{This|This article describes format of SFX files in GTA 3 and Vice City. For explanation of an SFX file in San Andreas see [[SFX (SA)]]}}
+
{{This|This article describes format of SFX files prior to San Andreas. For explanation of an SFX file in San Andreas see [[SFX (SA)]]}}
'''SFX''' file are an [[archive]] of short audio files used in [[GTA III]] and [[Vice City]]. They consist of the <code>sfx.raw</code> and <code>sfx.sdt</code> files and are typically located in the <code>..\audio</code> folder in the game directory.
+
'''SFX''' is a file [[archive]] of short audio effects used in [[GTA 2]], [[GTA III]], and [[Vice City]]. They consist of two file types, <code>.RAW</code> and <code>.SDT</code>, and are typically located in the <code>..\audio</code> folder in the game directory. Similar to an [[IMG archive]], the <code>.SDT</code> file is a binary file containing the directory and the <code>.RAW</code> contains the archive.
  
 
== File format ==
 
== File format ==
Similar to an [[IMG archive]], the sfx.sdt file contains the directory and the sfx.raw contains the archive. Each entry in the directory is 24 bytes in size:
+
=== SDT ===
 +
==== GTA 2 ====
 +
Each entry in the SDT file is 28 bytes in size:
 
  4b - int - offset of audio file in sfx.raw
 
  4b - int - offset of audio file in sfx.raw
 
  4b - int - size of audio file in bytes
 
  4b - int - size of audio file in bytes
 
  4b - int - samples per sec, the speed of audio
 
  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 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
 
  4b - int - loop end, where looping would end relative to audio file's position, -1 for end of audio file
The sfx.raw contains raw [[wikipedia:WAV|WAV]] files. Headers must be added for use in standard audio players when extracted. The following is the [http://csserver.evansville.edu/~blandfor/EE356/WavFormatDocs.pdf standard header] in terms of the SDT format.
+
 
 +
==== GTA III and Vice City ====
 +
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 - 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 [[wikipedia:WAV|WAV]] files. Headers must be added for use in standard audio players when extracted. The following is the [http://csserver.evansville.edu/~blandfor/EE356/WavFormatDocs.pdf standard header] in terms of the SDT format.
 
{|class="wikitable"
 
{|class="wikitable"
 
!Offset ||Type ||Identifier ||Description
 
!Offset ||Type ||Identifier ||Description
Line 45: Line 58:
 
=== GTA III ===
 
=== GTA III ===
  
{| class="wikitable mw-collapsible"
+
{| class="wikitable collapsible collapsed"
 
!style="width: 10em;" |SFX ||Description
 
!style="width: 10em;" |SFX ||Description
 
|-
 
|-
Line 532: Line 545:
  
 
=== Vice City ===
 
=== Vice City ===
{| class="wikitable mw-collapsible"
+
{| class="wikitable collapsible collapsed"
 
!style="width: 10em;" |SFX ||Description
 
!style="width: 10em;" |SFX ||Description
 
|-
 
|-
Line 1,158: Line 1,171:
 
* {{GTAF|157061|SFX Files Archive}}, documentation of all SFX files
 
* {{GTAF|157061|SFX Files Archive}}, documentation of all SFX files
 
* [http://spaceeinstein.webs.com/SFXsxript.txt A giant list of dialogue for Vice City's sfx file], my time-consuming and probably frivolous documentation
 
* [http://spaceeinstein.webs.com/SFXsxript.txt A giant list of dialogue for Vice City's sfx file], my time-consuming and probably frivolous documentation
 +
* {{Icon|3}} {{Icon|VC}} [http://spaceeinstein.altervista.org/sfx.php Listen to many SFX]
  
 
{{N|VC|3}}
 
{{N|VC|3}}
[[Category:Audio Formats]]
+
[[Category:GTA 2]][[Category:Audio Formats]]

Revision as of 06:19, 1 June 2015

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 28 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

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 - 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