Add some information about sound

This commit is contained in:
2020-03-26 20:47:05 +00:00
parent 3d3a55af9d
commit a0fd653c24
2 changed files with 27 additions and 6 deletions

View File

@@ -34,7 +34,7 @@ remake.
* `PWeight.dat` # Personality weights for the individual character types * `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 * `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 * `RandomPlanets.dat` # Campaign Primary and Secondary Objectives
* `Sounds.dat` # Sound Effect Data * [`Sounds.dat`](sound.md) # Sound Effect Data
* `SpellDef.dat` # SPELL DEFINITIONS * `SpellDef.dat` # SPELL DEFINITIONS
* `StdWeap.dat` # SQUAD STANDARD WEAPONS * `StdWeap.dat` # SQUAD STANDARD WEAPONS
* `Ultnames.dat` # List of names for ultramarines * `Ultnames.dat` # List of names for ultramarines
@@ -94,10 +94,10 @@ remake.
* `*.set` * `*.set`
* [✓] `SMK/` * [✓] `SMK/`
* `*.smk` # Videos: RAD Game Tools Smacker Multimedia version 2 * `*.smk` # Videos: RAD Game Tools Smacker Multimedia version 2
* `Sounds/` * [ ] `Sounds/`
* `wh40k.ds` # 0xffffffff then a list of .wav file names. Some sort of index? * [`wh40k.ds`](sound.md)
* [✓] `Wav/` * [ ] `Wav/`
* `*.wav` * [`*.wav`](sound.md)
Phew. Phew.
@@ -118,5 +118,5 @@ Phew.
* [`Maps/*.map`](maps.md): * [`Maps/*.map`](maps.md):
* [`Maps/*.txt`](maps.md#associated-txt-file) * [`Maps/*.txt`](maps.md#associated-txt-file)
* [`Sets/*.set`](sets.md) * [`Sets/*.set`](sets.md)
* [`Sounds/wh40k.ds`](sounds.md) * [`Sounds/wh40k.ds`](sound.md)
* `Wav/*.wav` * `Wav/*.wav`

21
doc/formats/sound.md Normal file
View File

@@ -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.