Difference between revisions of "EA Command And Conquer 3 Audio Codec"

From MultimediaWiki
Jump to navigation Jump to search
Line 10: Line 10:


  bytes 0-1    codec type
  bytes 0-1    codec type
                 0x0000  EA Layer 3
                 0x0000  Streamed audio (all known streamed audio uses EA Layer 3)
                 0x0400  EA ADPCM XAS mono
                 0x0400  EA ADPCM XAS mono
                 0x0404  EA ADPCM XAS stero
                 0x0404  EA ADPCM XAS stereo
                 0x040c  EA ADPCM XAS quad
                 0x040c  EA ADPCM XAS quad
                 0x0504  EALayer3 MPEG Layer 3 audio variant
                 0x0504  EALayer3 MPEG Layer 3 audio variant

Revision as of 19:29, 25 October 2007

This format is found on certain .cdata files used for sound effects/voice inside the *.BIG resource files of the new Command & Conquer 3 Demo. Using a program such as OS Big Editor 0.4 you can open the DemoStreams.big file from the C&C3 Demo and extract any .cdata file from the "data\global_demo_common\cdata" folder.

File Layout

The file begins with a 16-byte header, which is then followed by codec specific data. All numbers are encoded in big endian.

bytes 0-1    codec type
                0x0000   Streamed audio (all known streamed audio uses EA Layer 3)
                0x0400   EA ADPCM XAS mono
                0x0404   EA ADPCM XAS stereo
                0x040c   EA ADPCM XAS quad
                0x0504   EALayer3 MPEG Layer 3 audio variant
bytes 2-3    sample rate
bytes 4-7    total samples
bytes 8-11   total file size (bytes)
bytes 12-16  total samples

EA ADPCM XAS

XAS is a variation on the Electronic Arts XA codec that uses four independant PCM deltas.

Compressed audio data is arranged in 76-byte blocks that follow sequentially after the header. Each block corresponds to 128 audio samples. In files with stereo audio, the blocks alternate between left and right channels. For example, the first block is for the first channel, the next is for the second channel and so on.

Each block beings with a 16-byte header, and is followed by 15 x 4-byte compressed audio blobs.

Notes

Thanks to KMX at Derelict Studios for finding out the initial information on this format as it applies to C&C3.