Spotlight: GTAGaming.com - Latest on GTA IV! | Forums | Files | Cheats | Hosting | Shop | Members | Gaming | Network 
 Welcome, Guest Viewer.
 Register at edgedatabase.com!

 30,075 Members. 0 Online, 5 Guests.
Deus Ex 2 :: Information :: Audio File Format Specifications :: Appendix A

1. Introduction *)
2. Data Structures 
   2.1 Files
   2.2 Basic Types And Conventions
   2.3 String Type
   2.4 Offset Type
   2.5 SchemaMetafile_Harddrive.csc File Format
         2.5.1 File Format
         2.5.2 Sound Tags
         2.5.3 Tagged Sounds
         2.5.4 Mission Sounds
         2.5.5 Sound Information
   2.6 SchemaMetafile.csc File Format *)
3. Extracting/Inserting Sounds

Appendix A. Microsoft WAV File Format
Appendix B. DVI4/IMA ADPCM Audio Format
   B.1 The Deus Ex 2 Audio Format
   B.2 Decoding DVI4/IMA ADPCM
   B.3 Encoding DVI4/IMA ADPCM *)
Appendix C. Acknowledgements

*) Work in progress. Expect this to appear/improve in later revisions.

 

Microsoft WAV File Format

A RIFF/WAV file is build out of the same basic element every time. It consists of a collection of 'chunks'.


The basic chunk structure:

   struct SChunk
   {
      DWORD dwID;                // four character chunk identification.
      DWORD dwSize;              // size (in bytes) of the data in the chunk.

      BYTE  aData[dwSize];       // the data of the chunk.
   };

At the start of a WAV file there is a chunk which identifies the file, its size and its content. This chunk encapsulates a number of other chunks.


The top-level encapsulating structure:

   struct SRIFFChunk
   {  
      DWORD dwID;                // identification "RIFF".
      DWORD dwSize;              // size of data = 4 + size of all encapsulated chunks.

      DWORD dwFormat;            // data format identification "WAVE"
   };

The encapsulated chunks:

The format chunk specifies the audio format used in the audio data.

   struct SFormatChunk
   {
      // standard chunk data.
      DWORD dwID;                // identification "fmt ".
      DWORD dwSize;              // size of data = 16 for PCM (WAVEFORMAT) or
                                 // 18 + wExtraParamsSize for non-PCM (WAVEFORMATEX).

      // wave format data.
      WORD  wAudioFormat;        // 0x0001 = PCM, 0x0069 = Deus Ex 2 specific format.
      WORD	nNumChannels;        // number of audio channels (1 = mono, 2 = stereo, etc).
      DWORD nSampleRate;         // sample rate (samples per second).
      DWORD nAvgBytesPerSec;     // (average) byte rate (bytes per second).
      WORD  nBlockAlign;         // minimum size of an audio data block (bytes).
      WORD  nBitsPerSample;      // bits per sample.

      // optional data (for non-PCM).
      WORD  wExtraParamsSize;    // size (in bytes) of the extra parameters.
      BYTE  aExtraParams[wExtraParamsSize];
   };

The fact chunk only exists for non-PCM formats and provides some additional information about the sound.
Precise format for the fact chunk data is unclear at the moment, but also not important.


   struct SFactChunk
   {
      DWORD dwID;                // identification "fact".
      DWORD dwSize;              // size of data.

      BYTE  aData[dwSize];       // the fact data.
   };


The data chunk contains the actual audio data. :)

   struct SDataChunk
   {
      DWORD dwID;                // identification "data".
      DWORD dwSize;              // size of data.

      BYTE  aData[dwSize];       // the audio data.
   };

Note that other types of chunks are possible, but are not common. Always check the id when reading a chunk...

 

DEVELOPED ON ALIENWARE Proudly Sponsored by UGO Networks and Alienware Inc.
Copyright © 2000-2008 edgenetwork.org.  All Rights Reserved.
Generated in 0.05068s, 10 (96.66KB) Scripts, 5 SQL Queries (2.58%)