Descent 1,2 audio: Difference between revisions

From MultimediaWiki
Jump to navigation Jump to search
m (Correct formatting on page)
m (fix typo)
 
(2 intermediate revisions by one other user not shown)
Line 2: Line 2:
* Company: [[Interplay Entertainment]]
* Company: [[Interplay Entertainment]]


==Credit==
== Credit ==
This document is one of the many format documents written up by Valery V. Anisimovsky, and is available on wotsit.org.
The information on this page was originally based on one of the many format documents written up by Valery V. Anisimovsky, available on http://wotsit.org/ and many other sites across the internet.
 


== Byte Order ==
All multi-byte numbers are storedin little endian format.


== Descent 1 Sound FX ==
== Descent 1 Sound FX ==
In Descent 1 all sound files are stored in DESCENT.PIG file except for one file: DIGITEST.RAW which is in DESCENT.HOG.


The Descent 1 (v1.0) .PIG file has the following header:


In Descent 1 all sound files are stored in DESCENT.PIG file except for one
  bytes 0-3   nFiles
file: DIGITEST.RAW which is in DESCENT.HOG.
   bytes 4-7  nSoundFiles
As to Descent 1 (v1.0) .PIG file, it has the following header:
 
struct PIGHeader {
   DWORD nFiles
   DWORD nSoundFiles}
 


''nFiles'' -- this is the number of non-sound files in the PIG,
''nFiles'' -- this is the number of non-sound files in the PIG,
Line 23: Line 20:
''nSoundFiles'' -- this is the number of RAW sounds in the PIG.
''nSoundFiles'' -- this is the number of RAW sounds in the PIG.


Following the header go (''nFiles'') records describing non-sound files.
Following the header are (''nFiles'') records describing non-sound files. What we need to know about these records is that each of them is 17 bytes long.
What we need to know about these records is that each of them is 17 bytes long.


After those records go (''nSoundFiles'') records describing sounds. Each record
After those records are (''nSoundFiles'') records describing sounds. Each record has the following format:
has the following format:


struct DSNDEntry{
  bytes 0-7    szFileName
   char szFileName[8];
   bytes 8-11   nSamples
   DWORD nSamples;
   bytes 12-15  dwFileSize
   DWORD dwFileSize;
   bytes 16-19  dwFileStart
   DWORD dwFileStart;
};


''szFileName'' -- this is the name for sound padded with zeroes. Note that
''szFileName'' -- this is the name of the sound file, padded with zeroes. Note that there can be 8-character names which are thus not zero-terminated.
there're some 8 bytes long filenames which are thus not zero-terminated.


''nSamples'' -- the number of samples in RAW file.
''nSamples'' -- the number of samples in RAW file.
Line 43: Line 35:
''dwFileSize'' -- the size of RAW file (in bytes).
''dwFileSize'' -- the size of RAW file (in bytes).


''dwFileStart'' -- the starting position of the RAW file relative to the beginning
''dwFileStart'' -- the starting position of the RAW file relative to the beginning of the data files in PIG. That is, to get the starting position of the RAW file relative to the beginning of the PIG file you need to add (''dwFileStart'') to ''(sizeof(PIGHeader)+nFiles*17+nSoundFiles*sizeof(DSNDEntry))''.
of data files in PIG. That is, to get the starting position of the RAW file
relative to the beginning of the PIG file you need to add (''dwFileStart'') to
''(sizeof(PIGHeader)+nFiles*17+nSoundFiles*sizeof(DSNDEntry))''.


So, starting at that position goes RAW 8-bit unsigned mono data.
Starting at that position, there is audio formatted as uncompressed 8-bit unsigned mono [[PCM]] data. All sound files in Descent 1 .PIG should be played at 11025 Hz.
All sound files in Descent 1 .PIG should be played at 11025 Hz.


=== 1.4 Format===
=== 1.4 Format ===
Note that Descent v1.4 has slightly different .PIG file. Namely, it starts
Note that Descent v1.4 has slightly different .PIG file. Namely, it starts with a 32-bit value which is the position (relative to the .PIG file beginning) of PIGHeader. Starting at that position is a PIGHeader which is the same as described above.
with a DWORD value which is the position (relative to the .PIG file beginning)
of PIGHeader. Starting at that position is a PIGHeader which is just the same
to the described above.


== Descent 2 Sound FX==
== Descent 2 Sound FX==
In Descent 2 all sound files are stored in DESCENT2.S11 and DESCENT2.S22 except for DIGITEST.RAW which is in DESCENT2.HOG.


In Descent 2 all sound files are stored in DESCENT2.S11 and DESCENT2.S22
except for DIGITEST.RAW in DESCENT2.HOG.
.S11 and .S22 files have the following header:
.S11 and .S22 files have the following header:


struct DSNDHeader{
   bytes 0-3    szID
   char szID[4];
   bytes 4-7    dwDummy
   DWORD dwDummy;
   bytes 8-11  nFiles
   DWORD nFiles;
};


''szID'' -- string ID is always "DSND",
''szID'' -- string ID is always "DSND",


''dwDummy'' -- ??? looks like has no reasonable meaning,
''dwDummy'' -- unknown


''nFiles'' -- the number of files in .S11/.S22 file.
''nFiles'' -- the number of files in .S11/.S22 file.


After the header go (''nFiles'') DSNDEntry records (just the same as for Descent 1).
Following the header are (''nFiles'') records (just the same as for Descent 1). Just like in Descent 1, (''dwFileStart'') field of each entry is the starting position of the RAW file relative to the beginning of RAW files. That is, to get the starting position of the RAW file relative to the beginning of the .S11/.S22 file you need to add (''dwFileStart'') to ''(sizeof(DSNDHeader)+nFiles*sizeof(DSNDEntry))''.
Just like in Descent 1, (''dwFileStart'') field of each entry is the starting
position of the RAW file relative to the beginning of RAW files. That is,
to get the starting position of the RAW file relative to the beginning of
the .S11/.S22 file you need to add (''dwFileStart'') to
''(sizeof(DSNDHeader)+nFiles*sizeof(DSNDEntry))''.


==Playing the Audio==
== Playing the Audio ==
Each file in .S11/.S22 is 8-bit unsigned RAW. RAWs from .S11 should be played
Each file in .S11/.S22 is 8-bit unsigned mono [[PCM]] data. PCM data from .S11 should be played at 11025 Hz, while PCM data from .S22 should be played at 22050 Hz.
at 11025 Hz and from .S22 -- at 22050 Hz.


[[Category:Audio Codecs]]
[[Category:Game Formats]]
[[Category:Game Formats]]

Latest revision as of 07:05, 16 August 2006

Credit

The information on this page was originally based on one of the many format documents written up by Valery V. Anisimovsky, available on http://wotsit.org/ and many other sites across the internet.

Byte Order

All multi-byte numbers are storedin little endian format.

Descent 1 Sound FX

In Descent 1 all sound files are stored in DESCENT.PIG file except for one file: DIGITEST.RAW which is in DESCENT.HOG.

The Descent 1 (v1.0) .PIG file has the following header:

 bytes 0-3   nFiles
 bytes 4-7   nSoundFiles

nFiles -- this is the number of non-sound files in the PIG,

nSoundFiles -- this is the number of RAW sounds in the PIG.

Following the header are (nFiles) records describing non-sound files. What we need to know about these records is that each of them is 17 bytes long.

After those records are (nSoundFiles) records describing sounds. Each record has the following format:

 bytes 0-7    szFileName
 bytes 8-11   nSamples
 bytes 12-15  dwFileSize
 bytes 16-19  dwFileStart

szFileName -- this is the name of the sound file, padded with zeroes. Note that there can be 8-character names which are thus not zero-terminated.

nSamples -- the number of samples in RAW file.

dwFileSize -- the size of RAW file (in bytes).

dwFileStart -- the starting position of the RAW file relative to the beginning of the data files in PIG. That is, to get the starting position of the RAW file relative to the beginning of the PIG file you need to add (dwFileStart) to (sizeof(PIGHeader)+nFiles*17+nSoundFiles*sizeof(DSNDEntry)).

Starting at that position, there is audio formatted as uncompressed 8-bit unsigned mono PCM data. All sound files in Descent 1 .PIG should be played at 11025 Hz.

1.4 Format

Note that Descent v1.4 has slightly different .PIG file. Namely, it starts with a 32-bit value which is the position (relative to the .PIG file beginning) of PIGHeader. Starting at that position is a PIGHeader which is the same as described above.

Descent 2 Sound FX

In Descent 2 all sound files are stored in DESCENT2.S11 and DESCENT2.S22 except for DIGITEST.RAW which is in DESCENT2.HOG.

.S11 and .S22 files have the following header:

 bytes 0-3    szID
 bytes 4-7    dwDummy
 bytes 8-11   nFiles

szID -- string ID is always "DSND",

dwDummy -- unknown

nFiles -- the number of files in .S11/.S22 file.

Following the header are (nFiles) records (just the same as for Descent 1). Just like in Descent 1, (dwFileStart) field of each entry is the starting position of the RAW file relative to the beginning of RAW files. That is, to get the starting position of the RAW file relative to the beginning of the .S11/.S22 file you need to add (dwFileStart) to (sizeof(DSNDHeader)+nFiles*sizeof(DSNDEntry)).

Playing the Audio

Each file in .S11/.S22 is 8-bit unsigned mono PCM data. PCM data from .S11 should be played at 11025 Hz, while PCM data from .S22 should be played at 22050 Hz.