Jump to content

OBD:SNDD: Difference between revisions

2 bytes removed ,  12 December 2022
→‎PS2 implementation: there are lots of ambient sounds in the .RAW too (weapon hums, etc)
(→‎PS2 implementation: there are lots of ambient sounds in the .RAW too (weapon hums, etc))
Line 467: Line 467:
  0x40: 20 0F 20 41 D2 E3
  0x40: 20 0F 20 41 D2 E3
Here AC 00 is the 2-byte index of the sound (the same as in the SOUNDS\LEVEL1\SOUND.DAT and in the corresponding SNDD in level1_Final.dat), then there is the 4-byte data size (also the same as announced in the .dat and .DAT), followed by the same data as in the .SEP (32 zero bytes, then some 16-byte VAG packets, the last packet having a terminating bit set). At the very end of the .RAW file is a terminating pair of bytes, FE FF.
Here AC 00 is the 2-byte index of the sound (the same as in the SOUNDS\LEVEL1\SOUND.DAT and in the corresponding SNDD in level1_Final.dat), then there is the 4-byte data size (also the same as announced in the .dat and .DAT), followed by the same data as in the .SEP (32 zero bytes, then some 16-byte VAG packets, the last packet having a terminating bit set). At the very end of the .RAW file is a terminating pair of bytes, FE FF.
:'''N.B.''' It appears that SOUND.RAW is loaded in its entirely when a level starts, whereas sound data from a level's SOUND.SEP is (re)loaded on-demand. Accordingly, SOUND.RAW typically contains short [[OSIm|impulse]] sounds (gunshots, impacts, footsteps, hurt sounds). Permanent storage is not decided based on size alone, though, seeing as there are rather long impulse sounds (e.g. the 6-second SNDDheliflyby2) that are still stored in SOUND.RAW.
:'''N.B.''' It appears that SOUND.RAW is loaded in its entirely when a level starts, whereas sound data from a level's SOUND.SEP is (re)loaded on-demand. Accordingly, SOUND.RAW typically contains short recurrent sounds (gunshots, impacts, footsteps, hurt sounds, etc). Permanent storage is not decided based on size alone, though, seeing as there are rather long impulse sounds (e.g. the 6-second SNDDheliflyby2) that are still stored in SOUND.RAW.
:'''N.B.''' A level's SOUND.SEP always starts with the same 5 music segments as in LEVEL0/SOUND.SEP; those segments are indexed as 0 through 4, and do not have a corresponding SNDD in the chapter's level#_Final (i.e., the indices in level#_Final always start at 5 except for level0_Final, which only has those five SNDDs). It would seem that the sound indices listed in SOUND.DAT need to be unique across all the loaded level files. It would also seem that the duplicated storage of level0 music in all 14 chapters is highly suboptimal, using up 5 MB of disk space.
:'''N.B.''' A level's SOUND.SEP always starts with the same 5 music segments as in LEVEL0/SOUND.SEP; those segments are indexed as 0 through 4, and do not have a corresponding SNDD in the chapter's level#_Final (i.e., the indices in level#_Final always start at 5 except for level0_Final, which only has those five SNDDs). It would seem that the sound indices listed in SOUND.DAT need to be unique across all the loaded level files. It would also seem that the duplicated storage of level0 music in all 14 chapters is highly suboptimal, using up 5 MB of disk space.