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

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.