XACT XWB XSB XGS Audio: Difference between revisions

From XentaxWiki
Jump to navigation Jump to search
imported>Ikskoks
imported>Ikskoks
 
(377 intermediate revisions by the same user not shown)
Line 1: Line 1:
== General Info ==
'''XACT''' is Microsoft Cross-Platform Audio Creation Tool shared first with '''Xbox SDK''' and then with '''DirectX SDK'''. It uses XAP file format (XACT project file).<br>
The .xap files are processed at compile-time by the XACT program to '''xwb, xsb and xgs files''':<br><br>
XWB = XACT Wave Bank - a file format containing a collection of waves. Waves are the raw wave data in wav, aiff or xma format.<br>
XSB = XACT Sound Bank - a collection of sounds and cues.<br>
XGS = XACT General Settings -  defines rules and settings for sounds.<br>
The original release of XACT was in 2002 and shipped as part of the Xbox SDK only and was originally called the "'''Xbox Audio Creation Tool'''".
<br>Later it was modified to work with '''Microsoft Windows'''.
== XWB ==  
== XWB ==  


* ''' Format Type ''':    Archive / Audio <br>  
* ''' Format Type ''':    Audio <br>  
* ''' [http://en.wikipedia.org/wiki/Endianness Endian Order] ''': Little Endian <br>  
* ''' [http://en.wikipedia.org/wiki/Endianness Endian Order] ''': Little Endian / Big Endian<br>  
* ''' Signature ''':    WBND <br>  
* ''' Signature ''':    WBND / DNBW <br>  
 
 
=== XWB Format Specifications ===
 
<div class="toccolours mw-collapsible" id="mw-customcollapsible-myDivision" style="width:1000px; overflow:auto;">
<pre>
// XWB file format
// Based on XWBTool source code (March 2022)
// Compatible with XACT from DirectX SDK (June 2010)
 
 
//header
{
  4 bytes (char) - signature // "WBND" or "DNBW"
  4 bytes (uint32) - tool version (dwVersion / XACT_CONTENT_VERSION) // e.g. 46 for DirectX SDK (June 2010)
  4 bytes (uint32) - file format version (dwHeaderVersion)  // e.g. 44
 
 
  // segments list (segment lookup table)
  // 5 segments in total for version 46/44
  num_of_segments *
  {
      4 bytes (uint32) - region offset
      4 bytes (uint32) - region length
  }
}
 
// segment1 - bank data
{
  4 bytes (uint32) - bank flags (dwFlags)  // FLAGS_ENTRYNAMES = 0x00010000
                                            // FLAGS_COMPACT = 0x00020000
                                            // FLAGS_SYNC_DISABLED = 0x00040000
                                            // FLAGS_SEEKTABLES = 0x00080000
                                            // FLAGS_MASK = 0x000F0000
  4 bytes (uint32) - number of entries in the bank (dwEntryCount)
  64 bytes (char) - bank name (szBankName)  // e.g. "PinkPanther60", it's generated from wav name
  4 bytes (uint32) - size of each entry meta-data element, in bytes (dwEntryMetaDataElementSize)  // e.g. 4
  4 bytes (uint32) - size of each entry name element, in bytes (dwEntryNameElementSize)  // e.g. 0 or 64
  4 bytes (uint32) - entry alignment, in bytes (dwAlignment)  // e.g. 4
 
  // format data for compact bank (MINIWAVEFORMAT)
  4 bytes (uint32) - dwValue  //  2 bits - format tag
                                //  3 bits - channel count (1 - 6)
                                //  18 bits - sampling rate
                                //  8 bits - block alignment
                                //  1 bit - bits per sample
 
  // build timestamp
  4 bytes (uint32) - dwLowDateTime
  4 bytes (uint32) - dwHighDateTime
}
 
 
// segment2 - entry metadata
{
  num_of_wav_files *
  {
      if entry = ENTRYCOMPACT:
      {
        4 bytes (uint32) - entry meta-data element  // 21 bits - dwOffset (data offset)
                                                      // 11 bits - dwLengthDeviation (data length deviation)
      }
      else:
      {
          x bytes - entry meta-data element
      } 
  }
}
 
 
// segment3 - seek tables
// This segment is not used for PCM Audio
// But it's used by any other audio type supported by XWB file format
{
x bytes - seek tables data
}
 


// segment4 - entry names
// This segment is skipped if flag OPT_FRIENDLY_NAMES is not set in XWBTool
// Flag is set when "-f" option is passed to XWBTool,
// this is equivalent to checking "Friendly names" checkbox in XACT
{
  num_of_entries *
  {
      64 bytes (char) - entry name + padding  // e.g. "PinkPanther60"
  }
}


=== Format Specifications ===


<tt><b>
// segment5 - wave data
char {4}&nbsp;&nbsp;&nbsp;&nbsp; - Header <font color="purple">(WBND)</font> <br>
// Basically each entry is WAV file without RIFF header
uint32 {4}&nbsp;&nbsp; - Version <font color="purple">(3)</font> <br>
{
uint32 {4}&nbsp;&nbsp; - Size Of Header 1 <font color="purple">(40)</font> <br>
  num_of_wav_files *
uint32 {4}&nbsp;&nbsp; - Size Of Header 2 <font color="purple">(40)</font> <br>
  {
uint32 {4}&nbsp;&nbsp; - Offset To Details Directory <font color="purple">(80)</font> <br>
      x bytes - wave data
uint32 {4}&nbsp;&nbsp; - Length Of Details Directory <br>
  }
uint32 {4}&nbsp;&nbsp; - Offset To Filename Directory <br>
}
uint32 {4}&nbsp;&nbsp; - Length Of Filename Directory <br>
</pre>
uint32 {4}&nbsp;&nbsp; - First File Offset <font color="purple">(8192)</font> <br>
</div>
uint32 {4}&nbsp;&nbsp; - <font color="red"> '' Unknown '' </font> <br>
uint16 {2}&nbsp;&nbsp; - <font color="red"> '' Unknown <font color="purple">(1)</font> '' </font> <br>
uint16 {2}&nbsp;&nbsp; - <font color="red"> '' Unknown <font color="purple">(1)</font> '' </font> <br>
uint32 {4}&nbsp;&nbsp; - Number Of Files <br>
char {16}&nbsp;&nbsp;&nbsp; - Archive Filename <font color="purple">(null)</font> <font color="purple">(without extension)</font> <br>
uint32 {4}&nbsp;&nbsp; - Length Of Each Details Entry <font color="purple">(24)</font> <br>
uint32 {4}&nbsp;&nbsp; - Length Of Each Filename Entry <font color="purple">(64)</font> <br>
uint32 {4}&nbsp;&nbsp; - Max padding size between each file <font color="purple">(2048)</font> <br>
uint32 {4}&nbsp;&nbsp; - null <br>
<br>
<font color="blue"> ''' // for each file ''' </font> <br>
: uint16 {2}&nbsp;&nbsp; - <font color="red"> '' Unknown <font color="purple">(0/2)</font> '' </font> <br>
: uint16 {2}&nbsp;&nbsp; - <font color="red"> '' Unknown <font color="purple">(1)</font> '' </font> <br>
: uint32 {4}&nbsp;&nbsp; - <font color="red"> '' Unknown '' </font> <br>
: uint32 {4}&nbsp;&nbsp; - File Offset <font color="darkgreen">[+firstFileOffset]</font> <br>
: uint32 {4}&nbsp;&nbsp; - File Length <br>
: uint64 {8}&nbsp;&nbsp; - null <br>
<br>
<font color="blue"> ''' // for each file ''' </font> <br>  
: char {64}&nbsp;&nbsp;&nbsp; - Filename <font color="purple">(null)</font> <font color="purple">(without extension)</font> <br>
<br>
<font color="blue"> ''' // for each file ''' </font> <br>
: byte {X}&nbsp;&nbsp;&nbsp;&nbsp; - File Data <br>
: byte {0-2047}&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; - null Padding so the file length is a multiple of 2048 bytes) <br>  
<br>
<br>
</b></tt>


=== Format Specifications #2 ===
=== XWB Format Specifications (older version from XBOX SDK) ===
<tt><b>
<tt><b>
<font color="blue"> ''' // ARCHIVE HEADER ''' </font> <br>  
<font color="blue"> ''' // ARCHIVE HEADER ''' </font> <br>  
: char {4}&nbsp;&nbsp;&nbsp;&nbsp;  - Header <font color="purple">(WBND)</font> <br>  
: char {4}&nbsp;&nbsp;&nbsp;&nbsp;  - Signature <font color="purple">(WBND)</font> <br>  
: uint32 {4}&nbsp;&nbsp; - Version <br>  
: uint32 {4}&nbsp;&nbsp; - Tool Version <font color="purple">(1, 2 or 3)</font> <br>  
<br>
<br>
<font color="blue"> ''' // DIRECTORIES ''' </font> <br>
<font color="blue"> ''' // DIRECTORIES ''' </font> <br>
Line 87: Line 160:
: uint32 {4}&nbsp;&nbsp; - Loop region length (not sure what this does)  <br>  
: uint32 {4}&nbsp;&nbsp; - Loop region length (not sure what this does)  <br>  
<br>
<br>
 
</b>
 
</tt>
 
<font color="blue"> ''' // DUMPING FILES''' </font> <br>
Read the file records then seek to 'Offset of file data'(section 3) + File Offset.<br>
The files are wav's so you need to write a .wav header first and then copy the data<br>
<br>
 
Extra Checks:<br>
The number of channels can be wrong, sometimes its given as 0 or even 15 and sometimes it indicates a stereo file when its actually mono. The bottom line is - dont trust the 'number of channels' value. The correct number of channels can be worked out from the 'magic value', below is the code I use to do this:
function TPsychoAudioDumper.RepairXboxChannels(Format, MagicValue,
  Channels: cardinal): integer;
var
  Temp: integer;
begin
  if format=0 then //Pcm
  begin
    Temp:=(MagicValue - 4) mod 32;
    if Temp=0 then
      Result:=1
    else
      Result:=2;
  end
  else
  if format=1 then //Adpcm
  begin
    Temp:=(MagicValue - 5) mod 32;
    if Temp=0 then
      Result:=1
    else
      Result:=2;
  end
  else
    Result:=1;
end;
<br>
Similarly, the samplerate is sometimes wrong, so to correct this:<br>
 
function TPsychoAudioDumper.GetXboxSamplerate(Format, MagicValue,
  Channels: cardinal): integer;
begin
  if format=0 then //Pcm
  begin
    if Channels=1 then
    begin
      if MagicValue=2148894852 then //1 channel
        result:=44100
      else
      if MagicValue=2148507652 then //1 channel
        result:=32000
      else
      if MagicValue=2148189252 then //1 channel
        result:=22050
      else
      if MagicValue=705604 then //1 channel
        result:=22050
      else
      if MagicValue=352804 then //1 channel
        result:=11025
      else
      if MagicValue=256004 then //1 channel
        result:=8000
      else
        begin
          result:=0;
          if Assigned(FOnDebug) then
            FOnDebug('Unknown magic value! = ' + inttostr(magicvalue));
        end
    end
    else //2 channels
    begin
      if MagicValue=2148894856 then //2 channel
        result:=44100
      else
      if MagicValue=2148507656 then //2 channel
        result:=32000
      else
      if MagicValue=2148189256 then //2 channel
        result:=22050
      else
        begin
          result:=0;
          if Assigned(FOnDebug) then
            FOnDebug('Unknown magic value! = ' + inttostr(magicvalue));
        end
    end;
  end
  else
  if format=1 then //Adpcm
  begin
    Result:=(MagicValue - (1 + (Channels * 4))) div 32;
  end
  else
    Result:=0;
end;
<br>
Very rarely, the format tag is given as 2, this should be treated as format tag 0 - a normal pcm wave.<br>
<br>
</b></tt>


=== Notes and Comments ===  
=== Notes and Comments ===  


XWB files (Xbox Wavebanks) contain the audio data and are only used in the XBox version (and PC ports of XBOX games). XWB files are also used in many other XBox games, the specs here are only tested with Psychonauts though.<br>
XWB files (XACT Wavebanks) contain the audio data and are used in some XBOX and PC games.
<br>  
<br>  
XWB files contain 2 types of audio:<br>
XWB files contain following types of audio:<br>
: PCM - Standard Wave PCM<br>
: PCM - Standard Wave PCM<br>
: Xbox ADPCM - As used by many Xbox games<br><br>
: Xbox ADPCM - As used by many Xbox games<br>
: AIFF<br>
: WMA<br>
: xWMA<br>
: XMA<br><br>


The PCM audio can be played easily, to play the Xbox ADPCM however you either need to pass it through a decoder (there's one in [http://quick.mixnmojo.com/software.php#psychonautsexplorer Psychonauts Explorer]) or install the Xbox ADPCM codec.<br>
The PCM audio can be played easily, to play the Xbox ADPCM however you either need to pass it through a decoder (there's one in [http://quick.mixnmojo.com/software.php#psychonautsexplorer Psychonauts Explorer]) or install the Xbox ADPCM codec.<br>
<br>
<br>
The Wavebank doesnt contain any file names. This is because these are stored in a seperate file - the SoundBank file (.xsb). See below for info on this.<br>
The Wavebank may not contain any file names. This is because these may be stored in a seperate file - the SoundBank file (.xsb).
<br>


XWB audio files may occur along with [[XNA Game Studio 4.0 XNB|XNB Archives]].
XWB audio files may occur along with [[XNA Game Studio 4.0 XNB|XNB Archives]].
Line 205: Line 184:


* ''' Format Type ''':    Misc <br>  
* ''' Format Type ''':    Misc <br>  
* ''' [http://en.wikipedia.org/wiki/Endianness Endian Order] ''': Little Endian <br>  
* ''' [http://en.wikipedia.org/wiki/Endianness Endian Order] ''': Little Endian / Big Endian <br>  
* ''' Signature ''':    XGSF <br>  
* ''' Signature ''':    XGSF / FSGX<br>  




=== Format Specifications ===  
=== XGS Format Specifications ===  


<div class="toccolours mw-collapsible" id="mw-customcollapsible-myDivision" style="width:800px; overflow:auto;">
<div class="toccolours mw-collapsible" id="mw-customcollapsible-myDivision" style="width:800px; overflow:auto;">
<pre>
<pre>
//header
// Based on XGS file created by XACT from DirectX SDK (June 2010)
4 bytes (char) - Signature // "XGSF"
 
 
// header
4 bytes (char) - signature // "XGSF" or "FSGX"
2 bytes (uint16) - tool version  // e.g. 46
2 bytes (uint16) - file format version  // e.g. 42
 
// info
2 bytes (uint16) - CRC?
4 bytes (uint32) - last modification date (low value)
4 bytes (uint32) - last modification date (high value)
1 byte (uint8) - platform?  // 3 - PC
                            // 7 - XBOX
2 bytes (uint16) - number of categories
2 bytes (uint16) - number of variables
2 bytes (uint16) - unknown  // 16
2 bytes (uint16) - unknown  // 16
2 bytes (uint16) - number of run-time parameter controls
2 bytes (uint16) - number of DSP presets
2 bytes (uint16) - number of DSP params
4 bytes (uint32) - categories offset
4 bytes (uint32) - variables offset
4 bytes (uint32) - unknown offset  // points to "1"
4 bytes (uint32) - category name index offset
4 bytes (uint32) - unknown offset  // points to "2" and "3"
4 bytes (uint32) - variable name index offset
4 bytes (uint32) - category names offset
4 bytes (uint32) - variable names offset
4 bytes (uint32) - RPC offset  // "FF FF FF FF" if there are no RPCs
4 bytes (uint32) - DSP presets offset  // "FF FF FF FF" if there are no DSP presets
4 bytes (uint32) - DSP params offset  // "FF FF FF FF" if there are no DSP params


// TODO
// data
x bytes - categories
x bytes - variables
x bytes - categories names
x bytes - variable names
</pre>
</pre>
</div>
</div>


== XSB ==  
== XSB ==  


* ''' Format Type ''':    Misc <br>  
* ''' Format Type ''':    Misc <br>  
* ''' [http://en.wikipedia.org/wiki/Endianness Endian Order] ''': Little Endian <br>  
* ''' [http://en.wikipedia.org/wiki/Endianness Endian Order] ''': Little Endian / Big Endian <br>  
* ''' Signature ''':    SDBK <br>  
* ''' Signature ''':    SDBK / KBDS <br>  
 
 
=== XSB Format Specifications ===
 
<div class="toccolours mw-collapsible" id="mw-customcollapsible-myDivision" style="width:800px; overflow:auto;">
<pre>
// Based on XSB file created by XACT from DirectX SDK (June 2010)
 
 
// header
4 bytes (char) - signature  // "SDBK" or "KBDS"
2 bytes (uint16) - tool version // e.g. 46
2 bytes (uint16) - file format version  // e.g. 43
 
// info
2 bytes (uint16) - CRC (FCS16 checksum)
4 bytes (uint32) - last modification date (low value)
4 bytes (uint32) - last modification date (high value)
1 byte (uint8) - platform??  // 0 - PC
                            // 2 - XBOX
2 bytes (uint16) - number of simple cues
2 bytes (uint16) - number of complex cues
2 bytes (uint16) - unknown
2 bytes (uint16) - total number of cues
1 byte (uin8) - number of wavebanks
2 bytes (uint16) - number of sounds
4 bytes (uint32) - cue name table size




=== Format Specifications ===
// TODO
<tt><b>
</pre>
<font color="blue"> ''' // ARCHIVE HEADER ''' </font> <br>
</div>
: char {4}&nbsp;&nbsp;&nbsp;&nbsp;  - Header <font color="purple">(SDBK)</font> <br>
: uint32 {4}&nbsp;&nbsp; - ?<br>
: uint32 {4}&nbsp;&nbsp; - Offset of wavebank name <font color="purple">(Name is 16 bytes long)</font><br>
: byte {18}&nbsp;&nbsp;&nbsp;  - ? <br>
: uint16 {2}&nbsp;&nbsp; - Number of files <font color="purple">(File names)</font> <br>
: byte {28}&nbsp;&nbsp;&nbsp;  - Soundbank name? <br>
<br>
<font color="blue"> ''' // FILE RECORDS ''' </font> <br>
:<font color="blue"> ''' // FOR EACH FILE ''' </font> <br>
: uint32 {4}&nbsp;&nbsp; - Offset of filename <br>
: uint32 {4}&nbsp;&nbsp; - ? <br>
: uint32 {4}&nbsp;&nbsp; - ? <br>
: uint32 {4}&nbsp;&nbsp; - ? <br>
: uint32 {4}&nbsp;&nbsp; - ? <br>
<br>


Seek to 'Offset of filename' and read the filename (it is null terminated).<br>
<br>
I assume that the order of the filenames in the SoundBank corresponds to the order of the files in the WaveBank, but I dont know for sure. Be aware that sometimes there are more entries in a WaveBank than there are file names in a SoundBank, so some files have no name.<br>
<br>
</b></tt>
=== Notes and Comments ===  
=== Notes and Comments ===  


Line 260: Line 279:
Some WaveBanks do not have a corresponding SoundBank.<br>  
Some WaveBanks do not have a corresponding SoundBank.<br>  
<br>
<br>
== XAP ==
* ''' Format Type ''':    Misc <br>
* ''' [http://en.wikipedia.org/wiki/Endianness Endian Order] ''': Little Endian <br>
* ''' Signature ''':    XACT3 <br>
=== Example ===
<div class="toccolours mw-collapsible" id="mw-customcollapsible-myDivision" style="width:800px; overflow:auto;">
<pre>
// Example project file created by XACT from DirectX SDK (June 2010)
Signature = XACT3;
Version = 18;
Content Version = 46;
Release = June 2010;
Options
{
    Verbose Report = 0;
    Generate C/C++ Headers = 1;
}
Global Settings
{
    Xbox File = Xbox\2010 June_NEW.xgs;
    Windows File = Win\2010 June_NEW.xgs;
    Header File = 2010 June_NEW.h;
    Exclude Category Names = 0;
    Exclude Variable Names = 0;
    Last Modified Low = 3822374669;
    Last Modified High = 30954062;
    Category
    {
        Name = Global;
        Public = 1;
        Background Music = 0;
        Volume = 0;
        Category Entry
        {
        }
        Instance Limit
        {
            Max Instances = 255;
            Behavior = 0;
            Crossfade
            {
                Fade In = 0;
                Fade Out = 0;
                Crossfade Type = 0;
            }
        }
    }
...
</pre>
</div>
== SDK Compatibility Table ==
XACT program was shared with '''Xbox SDK''' from 2002 to 2005. <br>
Then it was shared with '''DirectX SDK''' from 2006 to 2010. <br>
Below table represents version compatibility for each SDK version.<br>
Whole list of different DirectX SDK executables can be found on [https://archive.org/details/directxsdks web archive].
{| class="wikitable sortable"
|-
!    SDK Version              !! XWB Tool Version    !! XWB File Format Version    !! Example Games Using This SDK
|-
|    Xbox SDK (unknown)      || 1                    || n/a                  || unknown       
|-
|    Xbox SDK (unknown)      || 2                    || n/a                  || Brute Force (XBOX)  <br>  Robot Wars Extreme Destruction (XBOX)     
|-
|    Xbox SDK v5849.15        || 3                    || n/a                  || Jumper: Griffin's Story (X360)  <br> ObsCure (XBOX)     
|-
|    Xbox SDK (unknown)      || 34                    || n/a                  || Ninety-Nine Nights (X360)         
|-
|    2006, April              || 38                  || n/a                    || unknown         
|-
|    2006, June              || 39                  || n/a                      || unknown           
|-
|    2006, August              || 40                || n/a                    || unknown         
|-
|    2006, December  <br>2007, February <br>2007, April              || 42                  || 42                    || unknown         
|-
|    2007, August              || 43                  || 42                    || unknown         
|-
|    2008, March  <br>2008, August              || 44                  || 42                    || Bully: Scholarship Edition v1.2 (PC)  <br>Saints Row 2           
|-
|    2009, March              || 45                  || 43                    || The Secret of Monkey Island: Special Edition v1.0 (PC)           
|-
|    2009, August <br>2010, February  <br>2010, June              || 46                  || 44                    || BlazBlue: Chronophantasma Extend (PC)  <br>Bleed v1.7.0 (PC)  <br>Nitroplus Blasterz (PC) <br>Skulls of the Shogun  <br>Terraria (X360)  <br>TowerFall Ascension (PC)         
|-
|}


== Other Info ==  
== Other Info ==  
Line 269: Line 401:
=== Compatible Programs ===  
=== Compatible Programs ===  


* foobar2000 + vgmstream plugin
* [https://sourceforge.net/projects/ekszbox-abx/ EkszBox-ABX]
* foobar2000 + vgmstream plugin (+ [https://github.com/vgmstream/vgmstream/blob/master/src/meta/xwb.c source code])
* [[Game Extractor|Game Extractor]]<br>
* [[Game Extractor|Game Extractor]]<br>
* [https://github.com/espes/MonoGame/tree/develop3d/MonoGame.Framework/Audio MonoGame.Framework]
* [http://quick.mixnmojo.com/software.php#psychonautsexplorer Psychonauts Explorer]<br>
* [http://quick.mixnmojo.com/software.php#psychonautsexplorer Psychonauts Explorer]<br>
* [https://github.com/trigger-segfault/QuickWaveBank/ QuickWaveBank] (+ source code)
* [https://web.archive.org/web/20220411181454/http://namgorf.com/towav.zip towav]
* [http://aluigi.altervista.org/papers/unxwb.zip unxwb] (supports version '''46/44''' and maybe others)
** Example extraction: "unxwb.exe file1.xwb"
* [https://drive.google.com/file/d/1615Luyhi8fd_g5zva83eeRZmbtavjp42/view?usp=sharing xactxtract] (supports only version '''45/43''')
* [http://www.kaisonic.net/xact360extract.zip xact360extract]
* XACT (Xbox Audio Creation Tool)
: DirectX SDK default location: C:\Program Files (x86)\Microsoft DirectX SDK (<version>)\Utilities\bin\x86\Xact3.exe
: XBOX SDK default location: C:\Program Files (x86)\Microsoft Xbox SDK\xbox\bin\xact.exe
* [https://www.microsoft.com/en-us/download/confirmation.aspx?id=39 XNA Game Studio 3.1]
* [https://forum.xentax.com/viewtopic.php?f=33&t=3998 XWB Extractor (by Crypton)]
* [https://github.com/bnnm/vgmstream-builds/blob/master/bin/xwb_split.zip xwb_split]
* [https://github.com/microsoft/DirectXTK/wiki/XWBTool XWBTool] (+ [https://github.com/microsoft/DirectXTK/tree/main/XWBTool source code])


=== Other Games ===  
=== Games ===  


These games use this file format<br>
These games use this file format<br>
* 007 Goldeneye (X360) (*.XWB / *.XGS / *.XSB)
* Age of Booty (PC) (*.XWB / *.XGS / *.XSB)
* Alan Wake (Bonus Disc)
* Bard's Tale (PC)
* BlazBlue: Chronophantasma Extend (PC) (*.XWB / *.XSB)
* Blazing Angels: Squadrons of WWII (PC)
* Bleed (PC) (*.XWB / *.XGS / *.XSB)
* Bleed (PC) (*.XWB / *.XGS / *.XSB)
* Brute Force (Xbox) (*.XWB / *.XSB) (version 2)
* Bully: Scholarship Edition
* Call of Juarez: Bound in Blood (PS3)
* Call of Juarez: Gunslinger
* Crackdown 1 (X360) (*.XWB)
* Conker: Live & Reloaded (Xbox)
* Darkwatch (XBox) *.xwb
* Drakensang
* Enchanted Arms (X360)
* Full Spectrum Warrior *.xwb
* Full Spectrum Warrior *.xwb
* Full Spectrum Warrior: Ten Hammers (PC) *.xwb
* Ghost Recon 2 (XBox) *.xwb
* Ghost Recon 2 (XBox) *.xwb
* Powerdrome *.xwb
* Gray Matter (*.XWB / *.XSB)
* I Maed A Gam3 W1th Z0mb1es 1n It!!!1
* Jumper: Griffin's Story (X360) (*.XWB / *.XSB) (version 3)
* Just Cause (X360) (*.XWB / *.XSB)
* Kameo: Elements of Power (X360)
* Kung Fu Strike
* Magicka
* Minecraft
* Ms. Splosion Man (X360)
* Ninja Blade (X360)
* Nitroplus Blasterz (PC) (no-extension)
* Operation Darkness (X360)
* Perfect Dark Zero (X360) (*.XWB)
* Powerdrome (PC) *.xwb
* Psychonauts *.xwb
* Psychonauts *.xwb
* Return To Castle Wolfenstein: Tide Of War (XBox) *.xwb
* Return To Castle Wolfenstein: Tide Of War (XBox) *.xwb
* Saint Row 2
* SBK 08 Superbike World Championship (PC)
* Skulls of the Shogun
* Star Trek Shattered Universe (XBox) *.xwb
* Star Trek Shattered Universe (XBox) *.xwb
* Sudeki *.xwb
* Sudeki (PC) *.xwb
* Supreme Commander (PC)
* Terraria
* The Misadventures of P.B. Winterbottom
* The Secret of Monkey Island: Special Edition (PC) (*.XWB / *.XGS / *.XSB)
* Trials HD (Xbox) *.xwb
* Top Spin 2 (PC)
* TowerFall Ascension (PC) (*.XWB / *.XGS / *.XSB)
* Two Worlds (PC)
* Unreal Championship 2 (XBox) *.xwb
* Unreal Championship 2: The Liandri Conflict (XBox) *.xwb
* Unreal Championship 2: The Liandri Conflict (XBox) *.xwb
* Worms Reloaded (*.XWB / *.XGS / *.XSB)
* Xblaze Code: Embryo
* Yager (PC)


=== See Also ===
=== See Also ===


* [[XNA Game Studio 4.0 XNB|XNB Archives]]
* [https://en.wikipedia.org/wiki/Cross-platform_Audio_Creation_Tool Cross-platform Audio Creation Tool (wikipedia)]
<br><br>
* [https://code.google.com/archive/p/monoxna/wikis/XnaFrameworkAudio.wiki monoxna - XnaFrameworkAudio.wiki]
* [https://wiki.multimedia.cx/index.php?title=XACT XACT description (multimedia.cx)]
* [https://cse.engineering.nyu.edu/jsterling/cs3113/Slides/20.XACT.pdf XACT.pdf]
* [[XNA Game Studio 4.0 XNB|XNB Archives (xentax wiki)]]
* [https://quickandeasysoftware.net/readmes/PsychonautsExplorerHelp/index.html?audiofileformats.htm XWB file format (PsychonautsExplorer)]
* [https://forum.xentax.com/viewtopic.php?p=183974#p183974 Tutorial for Export/Import XWB version 44/42 (forum.xentax.com)]
 
==Gallery==
<gallery bordercolor="transparent" spacing="small" orientation="landscape">
quick_wave_bank.png|Quick Wave Bank
XACT_2.png|XACT v3.0 (from DirectX SDK June 2010)
xact_xbox.png|XACT from Xbox SDK v5849.15
xact_xbox_readme.png|Help file for XACT
</gallery>
<br/><br>




[[Category:Complete WIP|XACT XWB XSB XGS Audio]]
[[Category:Platform PC|XACT XWB XSB XGS Audio]]
[[Category:Platform XBOX|XACT XWB XSB XGS Audio]]
[[Category:Platform X360|XACT XWB XSB XGS Audio]]
[[Category:Platform XONE|XACT XWB XSB XGS Audio]]
[[Category:CE None|XACT XWB XSB XGS Audio]]
[[Category:Format_Audio | Type: Audio]]
[[Category:Extension_xwb | Extension: xwb]]
[[Category:Extension_xsb | Extension: xsb]]
[[Category:Extension_xgs | Extension: xgs]]
[[Category:BMS_None | BMS: None]]
[[Category:File Format]]
[[Category:File Format]]

Latest revision as of 20:27, 5 July 2023

General Info

XACT is Microsoft Cross-Platform Audio Creation Tool shared first with Xbox SDK and then with DirectX SDK. It uses XAP file format (XACT project file).
The .xap files are processed at compile-time by the XACT program to xwb, xsb and xgs files:

XWB = XACT Wave Bank - a file format containing a collection of waves. Waves are the raw wave data in wav, aiff or xma format.
XSB = XACT Sound Bank - a collection of sounds and cues.
XGS = XACT General Settings - defines rules and settings for sounds.


The original release of XACT was in 2002 and shipped as part of the Xbox SDK only and was originally called the "Xbox Audio Creation Tool".
Later it was modified to work with Microsoft Windows.

XWB

  • Format Type : Audio
  • Endian Order : Little Endian / Big Endian
  • Signature : WBND / DNBW


XWB Format Specifications

// XWB file format
// Based on XWBTool source code (March 2022)
// Compatible with XACT from DirectX SDK (June 2010)


//header
{
   4 bytes (char) - signature // "WBND" or "DNBW"
   4 bytes (uint32) - tool version (dwVersion / XACT_CONTENT_VERSION) // e.g. 46 for DirectX SDK (June 2010)
   4 bytes (uint32) - file format version (dwHeaderVersion)  // e.g. 44


   // segments list (segment lookup table)
   // 5 segments in total for version 46/44
   num_of_segments *
   {
      4 bytes (uint32) - region offset
      4 bytes (uint32) - region length
   }
}

// segment1 - bank data
{
   4 bytes (uint32) - bank flags (dwFlags)  // FLAGS_ENTRYNAMES = 0x00010000
                                            // FLAGS_COMPACT = 0x00020000
                                            // FLAGS_SYNC_DISABLED = 0x00040000
                                            // FLAGS_SEEKTABLES = 0x00080000
                                            // FLAGS_MASK = 0x000F0000
   4 bytes (uint32) - number of entries in the bank (dwEntryCount)
   64 bytes (char) - bank name (szBankName)  // e.g. "PinkPanther60", it's generated from wav name 
   4 bytes (uint32) - size of each entry meta-data element, in bytes (dwEntryMetaDataElementSize)  // e.g. 4
   4 bytes (uint32) - size of each entry name element, in bytes (dwEntryNameElementSize)  // e.g. 0 or 64
   4 bytes (uint32) - entry alignment, in bytes (dwAlignment)  // e.g. 4

   // format data for compact bank (MINIWAVEFORMAT)
   4 bytes (uint32) - dwValue   //  2 bits - format tag
                                //  3 bits - channel count (1 - 6)
                                //  18 bits - sampling rate
                                //  8 bits - block alignment
                                //  1 bit - bits per sample
   
   // build timestamp
   4 bytes (uint32) - dwLowDateTime
   4 bytes (uint32) - dwHighDateTime
}


// segment2 - entry metadata
{
   num_of_wav_files *
   {
      if entry = ENTRYCOMPACT:
      {
         4 bytes (uint32) - entry meta-data element   // 21 bits - dwOffset (data offset)
                                                      // 11 bits - dwLengthDeviation (data length deviation)
      }
      else:
      {
          x bytes - entry meta-data element
      }  
   }
}


// segment3 - seek tables
// This segment is not used for PCM Audio
// But it's used by any other audio type supported by XWB file format
{
	x bytes - seek tables data
}


// segment4 - entry names
// This segment is skipped if flag OPT_FRIENDLY_NAMES is not set in XWBTool
// Flag is set when "-f" option is passed to XWBTool,
// this is equivalent to checking "Friendly names" checkbox in XACT
{
   num_of_entries *
   {
      64 bytes (char) - entry name + padding  // e.g. "PinkPanther60"
   }
}


// segment5 - wave data
// Basically each entry is WAV file without RIFF header
{
   num_of_wav_files *
   {
       x bytes - wave data
   }
}


XWB Format Specifications (older version from XBOX SDK)

// ARCHIVE HEADER

char {4}     - Signature (WBND)
uint32 {4}   - Tool Version (1, 2 or 3)


// DIRECTORIES
// Strictly speaking you can seek past this section, it (always?) refers to 4 directories

// DIR 1 - WAVE BANK INFO
uint32 {4}   - Offset
uint32 {4}   - Length
// DIR 2 - FILE RECORDS
uint32 {4}   - Offset
uint32 {4}   - Length
// DIR 3 - ALWAYS EMPTY?
uint32 {4}   - Offset
uint32 {4}   - Length
// DIR 4 - FILE DATA
uint32 {4}   - Offset
uint32 {4}   - Length


// DIR 1 - WAVE BANK INFO

uint32 {4}   - Flags
uint32 {4}   - Number of files
byte {16}    - Wavebank name (Padded with 0's)
uint32 {4}   - Size of each file record (in dir 2)
uint32 {4}   - Size of each entry name block
uint32 {4}   - Offset of file data
uint32 {4}   - Always null?


// DIR 2 - FILE RECORDS

// FOR EACH FILE
uint16 {2}   - Number of channels
uint16 {2}   - Format tag (0=normal pcm) (1=xbox adpcm)
uint32 {4}   - Magic value
uint32 {4}   - File offset (Relative to start of DIR 4)
uint32 {4}   - File size
uint32 {4}   - Loop region offset (not sure what this does)
uint32 {4}   - Loop region length (not sure what this does)


Notes and Comments

XWB files (XACT Wavebanks) contain the audio data and are used in some XBOX and PC games.
XWB files contain following types of audio:

PCM - Standard Wave PCM
Xbox ADPCM - As used by many Xbox games
AIFF
WMA
xWMA
XMA

The PCM audio can be played easily, to play the Xbox ADPCM however you either need to pass it through a decoder (there's one in Psychonauts Explorer) or install the Xbox ADPCM codec.

The Wavebank may not contain any file names. This is because these may be stored in a seperate file - the SoundBank file (.xsb).

XWB audio files may occur along with XNB Archives.

XGS

  • Format Type : Misc
  • Endian Order : Little Endian / Big Endian
  • Signature : XGSF / FSGX


XGS Format Specifications

// Based on XGS file created by XACT from DirectX SDK (June 2010)


// header
4 bytes (char) - signature // "XGSF" or "FSGX"
2 bytes (uint16) - tool version  // e.g. 46
2 bytes (uint16) - file format version  // e.g. 42

// info
2 bytes (uint16) - CRC?
4 bytes (uint32) - last modification date (low value)
4 bytes (uint32) - last modification date (high value)
1 byte (uint8) - platform?   // 3 - PC
                             // 7 - XBOX
2 bytes (uint16) - number of categories
2 bytes (uint16) - number of variables
2 bytes (uint16) - unknown  // 16
2 bytes (uint16) - unknown  // 16
2 bytes (uint16) - number of run-time parameter controls
2 bytes (uint16) - number of DSP presets
2 bytes (uint16) - number of DSP params
4 bytes (uint32) - categories offset
4 bytes (uint32) - variables offset
4 bytes (uint32) - unknown offset   // points to "1"
4 bytes (uint32) - category name index offset
4 bytes (uint32) - unknown offset   // points to "2" and "3"
4 bytes (uint32) - variable name index offset
4 bytes (uint32) - category names offset
4 bytes (uint32) - variable names offset
4 bytes (uint32) - RPC offset  // "FF FF FF FF" if there are no RPCs
4 bytes (uint32) - DSP presets offset  // "FF FF FF FF" if there are no DSP presets
4 bytes (uint32) - DSP params offset  // "FF FF FF FF" if there are no DSP params

// data
x bytes - categories
x bytes - variables
x bytes - categories names
x bytes - variable names

XSB

  • Format Type : Misc
  • Endian Order : Little Endian / Big Endian
  • Signature : SDBK / KBDS


XSB Format Specifications

// Based on XSB file created by XACT from DirectX SDK (June 2010)


// header
4 bytes (char) - signature  // "SDBK" or "KBDS"
2 bytes (uint16) - tool version // e.g. 46
2 bytes (uint16) - file format version  // e.g. 43

// info
2 bytes (uint16) - CRC (FCS16 checksum)
4 bytes (uint32) - last modification date (low value)
4 bytes (uint32) - last modification date (high value)
1 byte (uint8) - platform??  // 0 - PC
                             // 2 - XBOX
2 bytes (uint16) - number of simple cues
2 bytes (uint16) - number of complex cues
2 bytes (uint16) - unknown
2 bytes (uint16) - total number of cues
1 byte (uin8) - number of wavebanks
2 bytes (uint16) - number of sounds
4 bytes (uint32) - cue name table size


// TODO

Notes and Comments

XBox Soundbanks contain the file names for the files in their corresponding Wavebank, along with other, unknown data.

The name of the SoundBank corresponds to the WaveBank usually, eg ASMusic.xwb and ASMusic.xsb. If in doubt though, the SoundBank referrs to its WaveBank internally, so you can check.

Some WaveBanks do not have a corresponding SoundBank.

XAP

  • Format Type : Misc
  • Endian Order : Little Endian
  • Signature : XACT3


Example

// Example project file created by XACT from DirectX SDK (June 2010)

Signature = XACT3;
Version = 18;
Content Version = 46;
Release = June 2010;

Options
{
    Verbose Report = 0;
    Generate C/C++ Headers = 1;
}

Global Settings
{
    Xbox File = Xbox\2010 June_NEW.xgs;
    Windows File = Win\2010 June_NEW.xgs;
    Header File = 2010 June_NEW.h;
    Exclude Category Names = 0;
    Exclude Variable Names = 0;
    Last Modified Low = 3822374669;
    Last Modified High = 30954062;

    Category
    {
        Name = Global;
        Public = 1;
        Background Music = 0;
        Volume = 0;

        Category Entry
        {
        }

        Instance Limit
        {
            Max Instances = 255;
            Behavior = 0;

            Crossfade
            {
                Fade In = 0;
                Fade Out = 0;
                Crossfade Type = 0;
            }
        }
    }

...

SDK Compatibility Table

XACT program was shared with Xbox SDK from 2002 to 2005.
Then it was shared with DirectX SDK from 2006 to 2010.
Below table represents version compatibility for each SDK version.
Whole list of different DirectX SDK executables can be found on web archive.

SDK Version XWB Tool Version XWB File Format Version Example Games Using This SDK
Xbox SDK (unknown) 1 n/a unknown
Xbox SDK (unknown) 2 n/a Brute Force (XBOX)
Robot Wars Extreme Destruction (XBOX)
Xbox SDK v5849.15 3 n/a Jumper: Griffin's Story (X360)
ObsCure (XBOX)
Xbox SDK (unknown) 34 n/a Ninety-Nine Nights (X360)
2006, April 38 n/a unknown
2006, June 39 n/a unknown
2006, August 40 n/a unknown
2006, December
2007, February
2007, April
42 42 unknown
2007, August 43 42 unknown
2008, March
2008, August
44 42 Bully: Scholarship Edition v1.2 (PC)
Saints Row 2
2009, March 45 43 The Secret of Monkey Island: Special Edition v1.0 (PC)
2009, August
2010, February
2010, June
46 44 BlazBlue: Chronophantasma Extend (PC)
Bleed v1.7.0 (PC)
Nitroplus Blasterz (PC)
Skulls of the Shogun
Terraria (X360)
TowerFall Ascension (PC)

Other Info

quickBMS Script

Not written yet.

Compatible Programs

DirectX SDK default location: C:\Program Files (x86)\Microsoft DirectX SDK (<version>)\Utilities\bin\x86\Xact3.exe
XBOX SDK default location: C:\Program Files (x86)\Microsoft Xbox SDK\xbox\bin\xact.exe

Games

These games use this file format

  • 007 Goldeneye (X360) (*.XWB / *.XGS / *.XSB)
  • Age of Booty (PC) (*.XWB / *.XGS / *.XSB)
  • Alan Wake (Bonus Disc)
  • Bard's Tale (PC)
  • BlazBlue: Chronophantasma Extend (PC) (*.XWB / *.XSB)
  • Blazing Angels: Squadrons of WWII (PC)
  • Bleed (PC) (*.XWB / *.XGS / *.XSB)
  • Brute Force (Xbox) (*.XWB / *.XSB) (version 2)
  • Bully: Scholarship Edition
  • Call of Juarez: Bound in Blood (PS3)
  • Call of Juarez: Gunslinger
  • Crackdown 1 (X360) (*.XWB)
  • Conker: Live & Reloaded (Xbox)
  • Darkwatch (XBox) *.xwb
  • Drakensang
  • Enchanted Arms (X360)
  • Full Spectrum Warrior *.xwb
  • Full Spectrum Warrior: Ten Hammers (PC) *.xwb
  • Ghost Recon 2 (XBox) *.xwb
  • Gray Matter (*.XWB / *.XSB)
  • I Maed A Gam3 W1th Z0mb1es 1n It!!!1
  • Jumper: Griffin's Story (X360) (*.XWB / *.XSB) (version 3)
  • Just Cause (X360) (*.XWB / *.XSB)
  • Kameo: Elements of Power (X360)
  • Kung Fu Strike
  • Magicka
  • Minecraft
  • Ms. Splosion Man (X360)
  • Ninja Blade (X360)
  • Nitroplus Blasterz (PC) (no-extension)
  • Operation Darkness (X360)
  • Perfect Dark Zero (X360) (*.XWB)
  • Powerdrome (PC) *.xwb
  • Psychonauts *.xwb
  • Return To Castle Wolfenstein: Tide Of War (XBox) *.xwb
  • Saint Row 2
  • SBK 08 Superbike World Championship (PC)
  • Skulls of the Shogun
  • Star Trek Shattered Universe (XBox) *.xwb
  • Sudeki (PC) *.xwb
  • Supreme Commander (PC)
  • Terraria
  • The Misadventures of P.B. Winterbottom
  • The Secret of Monkey Island: Special Edition (PC) (*.XWB / *.XGS / *.XSB)
  • Trials HD (Xbox) *.xwb
  • Top Spin 2 (PC)
  • TowerFall Ascension (PC) (*.XWB / *.XGS / *.XSB)
  • Two Worlds (PC)
  • Unreal Championship 2 (XBox) *.xwb
  • Unreal Championship 2: The Liandri Conflict (XBox) *.xwb
  • Worms Reloaded (*.XWB / *.XGS / *.XSB)
  • Xblaze Code: Embryo
  • Yager (PC)

See Also

Gallery