diff --git a/doc/formats/index.md b/doc/formats/index.md index a76431b..a9eb5a7 100644 --- a/doc/formats/index.md +++ b/doc/formats/index.md @@ -34,7 +34,7 @@ remake. * `PWeight.dat` # Personality weights for the individual character types * `Random_AI.dat` # contains the percentage of the different AI types for each of the different Chaos Squad Types * `RandomPlanets.dat` # Campaign Primary and Secondary Objectives - * `Sounds.dat` # Sound Effect Data + * [`Sounds.dat`](sound.md) # Sound Effect Data * `SpellDef.dat` # SPELL DEFINITIONS * `StdWeap.dat` # SQUAD STANDARD WEAPONS * `Ultnames.dat` # List of names for ultramarines @@ -94,10 +94,10 @@ remake. * `*.set` * [✓] `SMK/` * `*.smk` # Videos: RAD Game Tools Smacker Multimedia version 2 -* `Sounds/` - * `wh40k.ds` # 0xffffffff then a list of .wav file names. Some sort of index? -* [✓] `Wav/` - * `*.wav` +* [ ] `Sounds/` + * [`wh40k.ds`](sound.md) +* [ ] `Wav/` + * [`*.wav`](sound.md) Phew. @@ -118,5 +118,5 @@ Phew. * [`Maps/*.map`](maps.md): * [`Maps/*.txt`](maps.md#associated-txt-file) * [`Sets/*.set`](sets.md) -* [`Sounds/wh40k.ds`](sounds.md) +* [`Sounds/wh40k.ds`](sound.md) * `Wav/*.wav` diff --git a/doc/formats/sound.md b/doc/formats/sound.md new file mode 100644 index 0000000..be058f1 --- /dev/null +++ b/doc/formats/sound.md @@ -0,0 +1,21 @@ +# Sound files information + +The Wav/ directory contains .wav files that are ADPCM-encoded. Old-fashioned, +not all WAV players support that any more :S. + +Then there's `Sounds/wh40k.ds`. Fortunately, this one has already been worked +out for me: https://forum.xentax.com/viewtopic.php?f=10&t=2359 + +> Hmm, I can have a look, but I should tell you that some wavs are actually saved in the wav folder in the demo, and NOT stored in the ds file, even though they are listed in the header of the ds file. +> +> It's not a very difficult algorithm, but it's not straightforward. The "data" part of each wave file is stored one after the other, they stripped the headers of each wave file and stored the "WAVEfmt " headers in a separate table. THen there's the problem of the "fact" header in a wave file. They do not store this info in the table, so I had some default values. The extractor puts everything back together to a single .wav file. +> +> Just open a .wav file with a hex editor and you can see each field in the wav header. (i.e. "RIFF", "WAVEfmt ", "fact" and "data"). +``` + +There's also `Data/Sounds.dat`, which ties constants to file names along with a +bit of metadata. + +Currently I'm preprocessing the `Wav/` files into .mp3 to get some sort of sound +playing, but it would be nice to get ADPCM support natively and also to be able +to play the sounds in the .ds file.