| MCS' Coding Tips
Adding extra digital sounds to the engine
Written by MCS
Tested by Quinnsey
Tips - "Success"!
Original Wolf 3D
|You should use FloEdit to add extra digital sounds to the engine. However, if you follow the instructions in FloEdit's help text, your game will bomb to DOS every time you try to play your new sounds, and the following error message is displayed:
SD_PlaySound: Uncached sound!
Flo's helptext on how to add new sounds starts like this:
Adding new sounds is easier than adding sprites. You just have to add constants in two sections of the code:
First, just add a name of your new sound (constant definition) to the table in file AUDIOWL6.H:
#define NUMSOUNDS 88 // Do NOT change this!
#define NUMSNDCHUNKS 290 // Do NOT change this!
I've found the "Do NOT change this" remarks to be incorrect. For every digital sound you add to the VSWAP, you have to adjust the value of both the NUMSOUNDS and the NUMSNDCHUNKS variable.
So if you add let's say 4 extra sounds, you should change the 88 to 92, and the 290 to 294.
Of course you also have to complete the other steps mentioned in FloEdit's help text before compiling.
I've also found that you always get this error when using Borland Turbo C++ 3.0, even if you adjust the NUMSOUNDS and NUMSNDCHUNKS values as described.