soundscape not looping

  • If you're asking a question make sure to set the thread type to be a question!

EmNudge

L4: Comfortable Member
Sep 23, 2015
184
60
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?
 

worMatty

Repacking Evangelist
aa
Jul 22, 2014
1,257
999
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.
 

EmNudge

L4: Comfortable Member
Sep 23, 2015
184
60
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.
didn't know that was needed. I did it and now it sounds like an unholy mess. still doesn't loop.
 

Pocket

Half a Lambert is better than one.
aa
Nov 14, 2009
4,694
2,579
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.
 

worMatty

Repacking Evangelist
aa
Jul 22, 2014
1,257
999
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.
 

EmNudge

L4: Comfortable Member
Sep 23, 2015
184
60
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.
worked! just deleted the sound casche file and it works just fine now, thanks!
 

EmNudge

L4: Comfortable Member
Sep 23, 2015
184
60
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.
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
 

worMatty

Repacking Evangelist
aa
Jul 22, 2014
1,257
999
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.