How to disable reverb on custom sounds in map

Discussion in 'Mapping Questions & Discussion' started by Mikroscopic, Nov 30, 2016.

  1. Mikroscopic

    aa Mikroscopic

    Messages:
    601
    Positive Ratings:
    605
    I'm trying to use some custom music sounds in a map and the environment of the map is making the sounds echo when I don't want them to. Is there a way to disable the reverb effects on an ambient_generic?
     
  2. henke37

    aa henke37

    Messages:
    1,876
    Positive Ratings:
    440
    Use a soundscript and check the mixer settings there.
     
  3. Dr. Orange

    Dr. Orange L6: Sharp Member

    Messages:
    362
    Positive Ratings:
    271
    If you add "#" to the sound path, it will be recognized as music by the engine, and will not be affected by dsp effects.
     
    • Thanks Thanks x 2
  4. Mikroscopic

    aa Mikroscopic

    Messages:
    601
    Positive Ratings:
    605
    Where? At the beginning? The end?
     
  5. Mikroscopic

    aa Mikroscopic

    Messages:
    601
    Positive Ratings:
    605
    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".
     
  6. Mikroscopic

    aa Mikroscopic

    Messages:
    601
    Positive Ratings:
    605
    Alright, I got it. You have to literally name the file with a # as the prefix, for example "#soundfile.mp3".
     
  7. Dr. Orange

    Dr. Orange L6: Sharp Member

    Messages:
    362
    Positive Ratings:
    271
    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.
     
    • Thanks Thanks x 3
  8. Mikroscopic

    aa Mikroscopic

    Messages:
    601
    Positive Ratings:
    605
    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.
     
  9. Dr. Orange

    Dr. Orange L6: Sharp Member

    Messages:
    362
    Positive Ratings:
    271
    Have you tried using soundscripts as well?
     
  10. Mikroscopic

    aa Mikroscopic

    Messages:
    601
    Positive Ratings:
    605
    @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: Jan 18, 2017
  11. Mikroscopic

    aa Mikroscopic

    Messages:
    601
    Positive Ratings:
    605
    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.
    [​IMG]
     
  12. Mikroscopic

    aa Mikroscopic

    Messages:
    601
    Positive Ratings:
    605
    Well somehow I finally got it to work. No idea what I had wrong, the *#filepath/name.mp3 format works now. Had to use snd_restart a few times. Weird.
     
  13. Pocket

    aa Pocket func_croc

    Messages:
    4,489
    Positive Ratings:
    2,217
    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.
     
  14. worMatty

    aa worMatty Repacking Evangelist

    Messages:
    1,072
    Positive Ratings:
    834
    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.
     
  15. Mikroscopic

    aa Mikroscopic

    Messages:
    601
    Positive Ratings:
    605
    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.
     
  16. Blinx

    Blinx L69: Deviant Member

    Messages:
    69
    Positive Ratings:
    39
    This is a problem on Valve's end, not yours, sound files missing from disk is your doing though.
     
  17. Mikroscopic

    aa Mikroscopic

    Messages:
    601
    Positive Ratings:
    605
    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.