soundscape not looping

Discussion in 'Mapping Questions & Discussion' started by 【EmNudge】, Oct 17, 2015.

  1. 【EmNudge】

    【EmNudge】 L4: Comfortable Member

    Messages:
    180
    Positive Ratings:
    37
    I have 2 soundscapes in my map around 7 seconds. I have them set to loop, here is the code:
    "emnudge.disco"
    {
    "dsp" "0"
    "playlooping"
    {
    "volume" "0.9"
    "pitch" "100"
    "wave" "soundscapes/pumped.wav"
    }
    }
    "emnudge.deathmatch"
    {
    "dsp" "0"
    "playlooping"
    {
    "volume" "0.9"
    "pitch" "100"
    "wave" "soundscapes/epic.wav"
    }
    }

    they play once and then stop. not looping

    how would I fix this?
     
  2. worMatty

    aa worMatty Repacking Evangelist

    Messages:
    1,072
    Positive Ratings:
    834
    Are they actually looped wav files? By that I mean you have inserted loop cue points in them using an audio editing program like GoldWave.
     
  3. 【EmNudge】

    【EmNudge】 L4: Comfortable Member

    Messages:
    180
    Positive Ratings:
    37
    didn't know that was needed. I did it and now it sounds like an unholy mess. still doesn't loop.
     
  4. Pocket

    aa Pocket func_croc

    Messages:
    4,489
    Positive Ratings:
    2,217
    Do they at least play all the way to the end? I discovered recently that TF2 has issues now with cutting WAV files short. I don't know what you'd have to do to flag an MP3 as loopable, but you'll probably want to use that format anyway since it'll cut down on the size of your pakfile.
     
  5. worMatty

    aa worMatty Repacking Evangelist

    Messages:
    1,072
    Positive Ratings:
    834
    Unfortunately an MP3 cannot be looped in a soundscape without some messing. There is a piece of info. on the discussion page for the SDK wiki page on soundscapes that explains how. Basically it's the playrandom key using a time value that makes the MP3 file play again a set number of seconds after it is played once. It can mess up if a player is listening to the soundscape when the waiting for players time ends, the map is reset and they trigger the same soundscape again consecutively.

    If you change an audio file but keep the same filename, for example when adding loop cue points or changing the codec or sample rate, you may hear a garbled mess. This is because the sound file was cached by TF2 when you had the older version and because you used the same filename it doesn't recache it, so the cached sound and the sound file are not compatible. You need to delete your sound.cache files, or change the sound filenames so that they are cached as new sounds. This may be the reason why your sounds now sound strange.

    The soundscape chunk you posted is fine.
     
    • Thanks Thanks x 1
  6. 【EmNudge】

    【EmNudge】 L4: Comfortable Member

    Messages:
    180
    Positive Ratings:
    37
    worked! just deleted the sound casche file and it works just fine now, thanks!
     
  7. 【EmNudge】

    【EmNudge】 L4: Comfortable Member

    Messages:
    180
    Positive Ratings:
    37
    seems that one of my soundscapes, the epic.wav one mentioned doesn't work at all, nothing to do with looping. this problem existed before but I ignored it until I got the pumped.wav working
     
  8. worMatty

    aa worMatty Repacking Evangelist

    Messages:
    1,072
    Positive Ratings:
    834
    Does your console throw up any errors? What happens if you put the sound file into an ambient_generic and attempt to play it manually in-game using ent_fire?

    Did you make the wav files yourself? Are they the same codec?

    If you have sounds files that don't loop, you should make them MP3 to save lots of space. MP3s need to be 128kbps 44.1khz.