How to disable reverb on custom sounds in map

henke37

aa
Sep 23, 2011
2,075
515
Use a soundscript and check the mixer settings there.
 
Jul 26, 2015
694
819
I tried putting a # before the filename and it says this in console when trying to play the sound:

Code:
MP3 initialized with no sound cache, this may cause janking. [  <soundfile.mp3> ]
Failed to create decoder for MP3 [  <soundfile.mp3> ]
*** Invalid sample rate (0) for sound '# <soundfile.mp3>'.

Putting it after just says "failed to load sound".
 
May 25, 2015
390
307
Here's an example from Half-Life 2:
"*#music/HL2_song16.mp3"

The "*" means that the sound file will stream from disc, meaning the game won't load the entire file at once which helps with longer sounds. The "#" means that the sound is treated as music, meaning it will be affected by the music sound volume option, and will not be affected by reverb.
 
Jul 26, 2015
694
819
So you only have to put the # in the sound path in the ambient_generic? That's exactly what I was trying, and it wasn't working. I tried using different formats:

"# folder/sound.mp3",
"#folder/sound.mp3",
"folder/sound.mp3#",

All of them failed to play the sound.
 
Jul 26, 2015
694
819
@Dr. Orange Now I'm using a soundscript; I have a file map_name_level_sounds.txt written like this:

Code:
"Sound.Name"
{
"channel" "CHAN_STATIC"
"soundlevel" "SNDLVL_NONE"
"volume" "VOL_NORM"
"wave" "#*file/path.mp3"
}

When I trigger the sound in the map, the game says

Code:
Failed to create decoder for MP3 [ file\path.mp3 ]
Failed to load sound "#*file\path.mp3", file probably missing from disk/repository
 
Last edited:
Jul 26, 2015
694
819
Okay, now I am completely confused. One of the sounds is working now, but other sounds that are written in the exact same format are giving me errors.
015caa4af4.png
 

Pocket

Half a Lambert is better than one.
aa
Nov 14, 2009
4,694
2,579
I was told that if you put custom sounds in your map, you have to manually clear out your sound.cache files every time you compile or pack, or you'll get errors. I guess running snd_restart has a similar effect.
 

worMatty

Repacking Evangelist
aa
Jul 22, 2014
1,257
999
Can't say I've ever needed to do that, Pocket. There was one time when my sounds sounded garbled in the game, like short bursts of static or noise, but that was due to me changing the file format but keeping the same filename. Since the game had already cached the sounds, its cache wasn't the same as the file contents, so I guess it played them at the wrong sample rate, or decoded them wrong. If you keep the same file path and file format when you pack the sounds, it shouldn't make a difference since the game is mounting them the same way whether they're from a BSP or stored locally.
 
Jul 26, 2015
694
819
FUCK I broke it again. All I did was literally add more sounds to the text file in the exact same format as the others and now all of them are broken.

Code:
Failed to create decoder for MP3 [ filepath\sound.mp3 ]
Failed to load sound "*#filepath\sound.mp3", file probably missing from disk/repository

snd_restart didn't fix it, nor did deleting sound.cache.

Keep in mind I have other custom sounds in the map that are not included in the soundscript (I just play them from their filepath) and these have never had any problems.
 
Jul 26, 2015
694
819
Okay, so it seems like what I have to do is:

Create the soundscript file without any modifying characters, run the map, go back to the file and put the characters in, save it, then run the map again, and then the sounds will work, with the proper effects. I suppose I have to do this every time I recompile the map.