This article will cover the various formats and ways audio is used in GoldSrc, from Vanilla to Sven Co-op. This is a collabrative work between The303 & Zode, also credit to the Mad Jonesy's Sven guide.
Part 1: Basic Sound and formats
Part 2: Sentences
Part 3: Materials
Part 4: CD Audio
Part 5: Models
Part 6: Sven Coop FMOD
Part 7: Sven Coop Replacements and Globals
Main format: Mono WAV only, 11025Hz or 22050Hz
For mouth-moving NPC audio: 8-bit unsigned PCM
For sound effects: 16-bit signed PCM
Music format: MP3, 44100Hz (Note: WON editions only support CD-audio)
Shon — 06/23/2022 5:44 PM Record stereo track at 22hz. Do edits > Limiter l5 r5 -03(precieved loudness), noise reduction, and agrresive (base) eq for best quality. Mix down to mono..
Sounds that loop need a embed in the WAV file called a "Cue Point" which tells the game to loop the sound instead of making it play just once. This can be done with several different programs:
1) Open your audio file then go to Tracks > Mix Stereo Sown to Mono This will convert to mono if your audio is not.
2) Go to the bottom left corner to Project Rate. Change to either 22050 or 11025 depending on what you need. You need to add a cue point/label to the sound file at the start. Apparently Audacity can do it and they're called "labels" where a lot of people use Goldwave which calls them cue points.
1 (OLD VERSION) Open your audio file then go to Process > Convert To Mono > Mix All Channels. This will convert to mono if your audio is not. (NEW VERSION: this is done at the save as... stage)
2) Go to Effect > Resample. Change to either 22050 or 11025 depending on what you need.
3)If your audio is for looping sounds, then you need to make a marker at the beginning. Tool>Cue Points... or "Cues" icon
4) Save as... and then press the attributes button and set to 16-bit PCM signed for normal sounds and If you need NPC jaw-flap audio set to 8-bit PCM unsigned
1) Open your audio file then go to Process > Convert To Mono > Mix All Channels. This will convert to mono if your audio is not.
2) Go to Process > Resample. Change to either 22050 or 11025 depending on what you need. If you need NPC jaw-flap audio you will need to go to Process > Resample and set to 8-bit
3)If your audio is for looping sounds, then you need to make a marker at the beginning. Use markers instead: Be sure your playhead is moved to the left all the way and then go to Tools > Markers > Create Marker
Placeholder text
Placeholder text
trigger_cdaudio
Value Mp3 file to play 12 Half-Life01.mp3 3 Prospero01.mp3 4 Half-Life12.mp3 5 Half-Life07.mp3 6 Half-Life10.mp3 7 Suspense01.mp3 8 Suspense03.mp3 9 Half-Life09.mp3 10 Half-Life02.mp3 11 Half-Life13.mp3 12 Half-Life04.mp3 13 Half-Life15.mp3 14 Half-Life14.mp3 15 Half-Life16.mp3 16 Suspense02.mp3 17 Half-Life03.mp3 18 Half-Life08.mp3 19 Prospero02.mp3 20 Half-Life05.mp3 21 Prospero04.mp3 22 Half-Life11.mp3 23 Half-Life06.mp3 24 Prospero03.mp3 25 Half-Life17.mp3 26 Prospero05.mp3 27 Suspense05.mp3 28 Suspense07.mp3 29 gamestartup.mp3 (also automatically plays upon launching the game) 30
Sounds can be played through NPC models, Weapon Viewmodels, and as well as be spoken using the jaw-flap procedural animation. The way this works is whenever an animation sequence is played and there is a sound even animation specified it will play back the sound.
Note: NPCs game code will precache specified named audio files. New wavs added may not be precached and will not play unless done so in game code. A hacky workaround for this is make an ambient_generic with this sound. Mods like Sven-Coop automatically precache any model sound specified
| Event | Event description | Extra parameters |
| 1004 | Play .wav file | .Wav file path |
| 1005 | Play sentence file | Sentence file path |
| 1008 | Play named .wav file through voice channel | .Wav file path |
| 1009 | Play random sentence group (25 % chance) |
|
| Monster specific events | ||
| 2001 | Monster drops light body |
|
| 2002 | Monster drops heavy body |
|
| 2010 | Monster plays swing or swish sound |
|
|
|
Clientside events for viewmodels |
|
| 5004 | Emit a sound | Wav file path |
This list is part of the larger model QC guide. Also reccomended reading is the model guide.
An example of making a sequence that plays a sound through the scientist voice channel (causing mouth animation) using event 1008 on frame 1 of the sequence (wav path is relative to sound folder in base game dir):
$sequence "checktie" "checktie" fps 12 { event 1008 1 "scientist/weartie.wav" }
Sven Co-op FMOD Supports:
AT9, AIFF, ASF, ASX, CELT, DLS, FLAC, FSB, IT, M3U, MID, MOD, MP2, MP3, OGG, PLS, S3M, VAG, WAV, WAX, WMA, XM
Reccomended to stick with the big 3 formats which is WAV, MP3 and OGG Vorbis. More info on FMOD in the official documentation here.
For 3D model play FMOD via Animation Eventuse event 5004 soundpath. But unlike regular sound entity you have to sure to precache via custom_precache map entity.
| Event | Event description | Extra parameters |
| 2003 | Plays footstep sound matching the material type set for the map textures (concrete, tile, dirt, metal, etc) | |
| 5004 | Custom sound format using FMOD system (AIFF, ASF, DLS, FLAC, IT, M3U, MID, MOD, MP2, MP3, OGG, S3M, VAG, WAV, WMA, XM) | custom sound path |
| 5005 | Use a custom sprite with paramaters defined via txt file | txt file path (path looks in "events" folder). Example txt file and usage found in "muzzle_example.txt" in the events folder. |
Placeholder text
Additional links:
How to sound like the Half-Life HEV Suit
Complete Music Tutorial by admer