First off you need the required sounds files you would like to use. These sounds must be 11khz 16bit PCM uncompressed .wav file. Then you will need to create an objects folder in your map. Do not forget to add the line "run objects/objects" in your init.con of your map. Now you need to create an "objects.con" file in your objects folder. In there, you need to write the line "steshelf_m1/steshelf_m1.con". The "steshelf_m1" part can be anything. It depends on the static object you use to coordinate the sourcepoint of your sound in your map. Remember that this works like a Spawnpoint, it also has a circular area that produces sound.
Now you will create a folder for example "steshelf_m1", with the
required "steshelf_m1.con" file. .con files are created from .txt files. Just rename them to .con. You also open these with Notepad. In the "steshelf_m1.con" file you need to refer to the actual "worker" files. You will have to create the following files, with the following content in the same folder as you placed the "steshelf_m1.con" file.
geometries.con
GeometryTemplate.create StandardMesh steshelf_m1
GeometryTemplate.file none
GeometryTemplate.setLodDistance 0 0
GeometryTemplate.setLodDistance 1 10
GeometryTemplate.setLodDistance 2 15
GeometryTemplate.setLodDistance 3 30
GeometryTemplate.setLodDistance 4 50
GeometryTemplate.setLodDistance 5 100
objects.con
ObjectTemplate.create SimpleObject steshelf_m1
ObjectTemplate.saveInSeparateFile 1
ObjectTemplate.geometry PlateShelf_M1
ObjectTemplate.hasCollisionPhysics 1
objectTemplate.loadSoundScript Sounds/steshelf_m1.ssc
steshelf_m1.con
run Geometries.con
run Objects.con
As you can see, you also need to place a sound folder within the "steshelf_m1" folder. In there, you create the "steshelf_m1.ssc" file. Also by renaming a .txt file.
steshelf_m1.ssc
#templateLevel HIGH
newPatch
############
### Near ###
############
load bf1942/levels/Mylevel/sounds/Mysound.wav
loop
minDistance 5
randomStartPitch 0.25 / 0.0
volume 1.0
priority 9
#templateLevel MEDIUM
newPatch
############
### Near ###
############
load bf1942/levels/Mylevel/sounds/Mysound.wav
loop
minDistance 5
randomStartPitch 0.25 / 0.0
volume 1.0
priority 9
You notice different values within the file.
loop = Means that the sound file will loop continually.
minDistance 5 = If the player is within 5 metres of the object, the sound will be playing.
randomStartPitch 0.25 / 0.0 = I'm not really sure about this one. Never touched it.
volume 1.0 = Obvious eh? Valid values are 0.0 - 1.0 Note: sounds are lower ingame.
priority 9 = If you have two sounds playing within eachothers range, only one can be the top one. If another sound has a priority of 8, the sound with a priority of 9 will be best heard.
Don't forget to change the lines of that file. Now you only need a sound folder in your map folder. In there you place the .wav files. It should be working fine now. If not, give me a hunch.
Oh yeah. I use Goldwave to edit sounds. Very easy. Download
here. This version is better than the newer one in terms of usability.
You can also use environmental sound scripting. This means a standard, looped background sound for your map.
First you need to add the line "run sounds/environment" in the init.con of your map. Now you will have to create a new folder, named "sounds" in your map folder. Remember that the line you need to add in the init.con may already be present, but check anyway. In this "sounds" folder, you need to add two files:
environment.con
EnvironmentSound.load Environment.ssc
environment.ssc
#templateLevel HIGH
newPatch
############
### Near ###
############
load bf1942/levels/Mylevel/sounds/@RTD/Mysound.wav
loop
minDistance 10
randomStartPitch 0.25 / 0.0
volume 1.0
priority 10
#templateLevel MEDIUM
newPatch
############
### Near ###
############
load bf1942/levels/Mylevel/sounds/@RTD/Mysound.wav
loop
minDistance 10
randomStartPitch 0.25 / 0.0
volume 1.0
priority 10
#templateLevel LOW
newPatch
############
### Near ###
############
load bf1942/levels/Mylevel/sounds/@RTD/Mysound.wav
loop
minDistance 10
randomStartPitch 0.25 / 0.0
volume 1.0
priority 10
Very good. Now we will create three folders in the same "sound" folder. These are "11khz", "22khz", and "44khz". In every one of the folders, you will place the background sound you wish to use for your map. In Goldwave, convert your sounds to the appropriate values. Choose file>batch conversion. Select the sound file you wish to use. It's best to use the 44khz file as the base file. Click "add file", and choose the sound file.
Now choose the destination source. This would be: "bf1942/levels/Mylevel/sounds/22khz" (assuming you already copied the file to the 44khz folder, which doesn't need converting in this case). Choose 16bit and 22100 for options and start batching. Do this again for the 11khz folder, and choose the 16bit 11.050 for options.
What does it do? Each user has his own sound settings. If he uses 44khz, he won't have to put up with a standard 11khz file. Bf1942 will automatically choose for the 44khz file, with better quality.