Anyone who has ever found a need to hack their sounds.tbl will recognise this:
; I M P O R T A N T
; **********************************************************
; * *
; ====> DO NOT MODIFY THE ORDER OF THE LISTED SOUNDS <====*
; * *
; **********************************************************
; I M P O R T A N T
;
; If a sound entry appears in this file, there is a hook into the game to
; play the sound. This file can only be modified to change *existing* sounds.
; Talk to a programmer if you want to add brand new sounds. Adding a line to
; this file will not make your sound appear in the game, it will more than
; likely break something.
Today I discovered that this is not exactly true.
Until today, my tried and true method of adding sounds to the game was to use one of the 10 empty slots marked as 162 through 172 in the #Game Sounds section. This worked fine, with no problems. But I got curious this morning...
The last sound in the standard sounds.tbl for the #Game Sounds section is number 191. So I put in a new line, marked as number 192, referenced to a custom sound file in data\sounds\8b22k. Then, on a beam weapon I have made up, I set its warmup sound to 192 in its weapons.tbl entry. When the beam fired in mission, it played the custom sound.
So basically, one can add sounds to the table, so long as the new sounds are referenced by another table such as weapons.tbl or ships.tbl. For example, one can set custom engine sounds for ships in the ships.tbl, and custom weapons sounds in the weapons.tbl as I have done.
Many of the sounds in the table are not referenced in another table, so I'm guessing the information regarding their use is hardcoded and can't be messed with like this. Therefore, one should not change the order of sounds already in the table; one can only add new ones.