XA Audio: Difference between revisions

From XentaxWiki
Jump to navigation Jump to search
imported>Ikskoks
imported>Ikskoks
 
(45 intermediate revisions by the same user not shown)
Line 2: Line 2:
* ''' Format Type ''':    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 <br>
* ''' Signature ''':    RIFF <br>




Line 9: Line 10:
<pre>  
<pre>  
// XA file format  
// XA file format  
// Used in PlayStation 1 games


// little endian
// little endian


//header
//header
4 bytes (char) - magic // "RIFF"
4 bytes (char) - signature // "RIFF"
4 bytes (uint32) - filesize - 8
4 bytes (uint32) - filesize - 8
8 bytes (char) - XA ID string // "CDXAfmt "
8 bytes (char) - XA ID string // "CDXAfmt "
Line 21: Line 23:
4 bytes (uint32) - size of data
4 bytes (uint32) - size of data


//data
// Note: num_of_sectors can be calculated
x bytes - data
// like this: size_of_data / 2352


//audio data (2352 bytes per entry)
num_of_sectors *
{
  24 bytes - sync + header + submode + subheader
  128*18 bytes - sound groups  // 128 bytes per sound group
  24 bytes - unused + edc
}
</pre>
</div>
=== Related Structures ===
<div class="toccolours mw-collapsible" id="mw-customcollapsible-myDivision" style="width:800px; overflow:auto;">
<pre>
// ADPCM RAW sector file format
// Note: RAW data of a CD sector is 2352 bytes
// per sector, this sector has the below structure
BYTE sync[12]={ 0,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0  }; // the sync pattern
struct
{
BYTE minutes; // timecode relative to start of disk
BYTE seconds; // timecode relative to start of disk
BYTE sectors; // timecode relative to start of disk
BYTE mode; // Form 2 for ADPCM audio sectors
} header;
struct
{
BYTE file_number; // used to identify sectors belonging to the same file
BYTE channel; // 0-15 for ADPCM audio
BYTE
{
bit 7: eof_marker; // 0 for all sectors except last sector of file
bit 6: real_time; // 1 for real time mode, see above description
bit 5: form; // 1 for ADPCM sector (form 2, 0 for form 1)?
bit 4: trigger; // used for application
bit 3: data; // dependant on sector type, 0 for ADPCM sector
bit 2: audio; // dependant on sector type, 1 for ADPCM sector
bit 1: video; // dependant on sector type, 0 for ADPCM sector
bit 0: end_of_record; // identifies end of audio frame
} submode;
BYTE
{
bit 7: reserved; // "0"
bit 6: emphasis;
bit 5,4: bits_per_sample; // 00=4bits (B,C format) 01=8bits
bit 3,2: sample_rate; // 00=37.8kHz (A,B format) 01=18.9kHz
bit 1,0: mono_stereo; // 00=mono 01=stereo, other values reserved
} coding_info;
BYTE copy_of_file_number; // file_number
BYTE copy_of_channel; // channel
BYTE copy_of_submode; // submode
BYTE copy_of_coding_info; // coding_info
} subheader;
struct
{
BYTE sound_parameters[16];
BYTE audio_sample_bytes[112];
} soundgroups[18];
BYTE unused_for_adpcm[20];
BYTE edc[4]; // error correction code or 0
</pre>
</pre>
</div>
</div>
Line 33: Line 102:
=== Notes and Comments ===  
=== Notes and Comments ===  


* PlayStation 1 audio files.
* XA files are PlayStation 1 audio files.
* XA stands for "eXtended Architecture" (extending the "Yellow Book" standard).
* The XA ADPCM Audio on PlayStation discs are stored in "Green Book" "Mode 2 Form 2" sectors. These sectors also have a 24 byte header, but there is no data at the end for error correction--just 4 leftover bytes. This leaves 2324 bytes for data.


=== Games ===  
=== Games ===  
List of games using this file format:
List of games using this file format:
* [[Urban Chaos]]
* Chicken Run (PS1) (*.STR)
* MediEvil
* [[Urban Chaos]] (PS1) (*.STR)
* MediEvil (PS1) (*.STR)
* NBA Live 97 (PS1) (*.XA)
* [[PGA Tour 97]] (PS1) (*.STR)
* Ready 2 Rumble Boxing (PS1) (*.XA)
* Many more...
* Many more...


Line 45: Line 120:
* CDXATOOL
* CDXATOOL
* CDXAUtil
* CDXAUtil
* CDXA
* foobar2000 + vgmstream plugin
* xa2wav
* xa2wav
* XA2WAVE
* XA2WAVE
Line 55: Line 132:




[[Category:Complete WIP|XA]]
[[Category:Complete Complete|XA]]
[[Category:Platform PS1|XA]]
[[Category:Platform PS1|XA]]
[[Category:CE None|XA]]
[[Category:CE None|XA]]
Line 61: Line 138:
[[Category:Extension_xa | Extension: xa]]
[[Category:Extension_xa | Extension: xa]]
[[Category:BMS_None | BMS: None]]
[[Category:BMS_None | BMS: None]]
[[Category:File Format]]

Latest revision as of 23:18, 19 November 2022

XA

  • Format Type : Audio
  • Endian Order : Little Endian
  • Signature : RIFF


Format Specifications

 
// XA file format 
// Used in PlayStation 1 games

// little endian

//header
4 bytes (char) - signature // "RIFF"
4 bytes (uint32) - filesize - 8
8 bytes (char) - XA ID string // "CDXAfmt "
4 bytes (uint32) - size of next block
16 bytes - some block // "=UXA"
4 bytes (char) - data ID string " // "data"
4 bytes (uint32) - size of data

// Note: num_of_sectors can be calculated 
// like this: size_of_data / 2352

//audio data (2352 bytes per entry)
num_of_sectors *
{
   24 bytes - sync + header + submode + subheader
   128*18 bytes - sound groups  // 128 bytes per sound group
   24 bytes - unused + edc
}

Related Structures

 
// ADPCM RAW sector file format

// Note: RAW data of a CD sector is 2352 bytes 
// per sector, this sector has the below structure

BYTE	sync[12]={ 0,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0  }; // the sync pattern 

struct
{
	BYTE	minutes;	// timecode relative to start of disk
	BYTE	seconds;	// timecode relative to start of disk
	BYTE	sectors;	// timecode relative to start of disk
	BYTE	mode;		// Form 2 for ADPCM audio sectors
} header;

struct
{
	BYTE	file_number;	// used to identify sectors belonging to the same file
	BYTE	channel;	// 0-15 for ADPCM audio
	BYTE
	{
		bit 7: eof_marker;	// 0 for all sectors except last sector of file
		bit 6: real_time;	// 1 for real time mode, see above description
		bit 5: form;		// 1 for ADPCM sector (form 2, 0 for form 1)?
		bit 4: trigger;		// used for application
		bit 3: data;		// dependant on sector type, 0 for ADPCM sector
		bit 2: audio;		// dependant on sector type, 1 for ADPCM sector
		bit 1: video;		// dependant on sector type, 0 for ADPCM sector
		bit 0: end_of_record;	// identifies end of audio frame
	} submode;
	BYTE
	{
		bit 7: reserved;		// "0"
		bit 6: emphasis;
		bit 5,4: bits_per_sample;	// 00=4bits (B,C format) 01=8bits
		bit 3,2: sample_rate;		// 00=37.8kHz (A,B format) 01=18.9kHz
		bit 1,0: mono_stereo;	// 00=mono 01=stereo, other values reserved
	} coding_info;
	BYTE	copy_of_file_number;	// file_number
	BYTE	copy_of_channel;	// channel
	BYTE	copy_of_submode;	// submode
	BYTE	copy_of_coding_info;	// coding_info

} subheader;

struct
{
	BYTE	sound_parameters[16];		
	BYTE	audio_sample_bytes[112];	
} soundgroups[18];


BYTE	unused_for_adpcm[20];
BYTE	edc[4];				// error correction code or 0

MultiEx BMS Script

Not written yet.

Notes and Comments

  • XA files are PlayStation 1 audio files.
  • XA stands for "eXtended Architecture" (extending the "Yellow Book" standard).
  • The XA ADPCM Audio on PlayStation discs are stored in "Green Book" "Mode 2 Form 2" sectors. These sectors also have a 24 byte header, but there is no data at the end for error correction--just 4 leftover bytes. This leaves 2324 bytes for data.

Games

List of games using this file format:

  • Chicken Run (PS1) (*.STR)
  • Urban Chaos (PS1) (*.STR)
  • MediEvil (PS1) (*.STR)
  • NBA Live 97 (PS1) (*.XA)
  • PGA Tour 97 (PS1) (*.STR)
  • Ready 2 Rumble Boxing (PS1) (*.XA)
  • Many more...

Compatible Programs

  • CDXATOOL
  • CDXAUtil
  • CDXA
  • foobar2000 + vgmstream plugin
  • xa2wav
  • XA2WAVE
  • xacopy
  • XAEX
  • xaplay
  • XA Audio Converter
  • PSound