Ambient_generic not looping?

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

Gravidea

L5: Dapper Member
Apr 17, 2017
227
102
On the map I am currently working on, I have set a 17 minute track that plays around the map with a few different songs on it. I figured that ambient_generic would be the best option because it allows me to select my music when I put it in the /sounds folder (unlike soundscapes). I first tried putting it in with the .wav file form. When I loaded up the map, it caused me to run with only 8 fps and I didn't hear any sounds (for reference, it does NOT normally do this). When I switched the format to .mp3 however, the song worked perfectly.

I waited 17 minutes, but despite the song playing smoothly and at the correct volume, it did not loop back to the start despite having the "Is NOt Looped" flag unchecked. I was told to use Goldwave to set loop cues or something like that, but the program is not free and I'm not paying 45$ for a looped sound on my map, because that would be the only thing I would use it for. Audacity doesn't do loop cues, that or it doesn't make it clear on how to. Either way, apparently that's only on .wav files and it seems to make the map run on 8 fps as I said before.

If you could provide an answer that is simple, as I'm not too familiar with all this, it would be much appreciated. Thanks for any help that may be offered!
 

Idolon

they/them
aa
Feb 7, 2008
2,105
6,106
If you want loop cues, Wavosaur is a free program that can add them.

I'm guessing the lag is because you're dealing with a 17 minute audio track. If you want to use Source's sound looping, you'll probably have to shorten the audio file to something more manageable. However, since your audio file is just a series of songs, you probably don't need a seamless loop. A logic_timer can repeat the sound every however many seconds you need to make an imperfect loop, and it should sound fine.
 

Gravidea

L5: Dapper Member
Apr 17, 2017
227
102
A logic_timer can repeat the sound every however many seconds you need to make an imperfect loop, and it should sound fine.
Yeah, the song ends with a few seconds to spare. I'm thinking that I can just set up the logic_timer to repeat it after 17 minutes, as the last song ends and I can just make it start from the beginning of the first song. That was basically my plan. Can you explain how I would be able to use the logic_time to do this? Also, thank you for your quick response.

Edit: Also I was incorrect. The song is 20 minutes and 35 seconds long.
 
Last edited:

Idolon

they/them
aa
Feb 7, 2008
2,105
6,106
Set the logic_timer's refire interval to 1235 seconds (20 minutes 35 seconds) and have the OnTimer output trigger the ambient_generic.
 

Gravidea

L5: Dapper Member
Apr 17, 2017
227
102
Set the logic_timer's refire interval to 1235 seconds (20 minutes 35 seconds) and have the OnTimer output trigger the ambient_generic.
So would this work then? I set the refire interval to 1235.
logic_timer.png
 

Gravidea

L5: Dapper Member
Apr 17, 2017
227
102
I went ahead and ran the map and waited the time it took for the track to end, but unfortunately it seems that the track won't loop, even with the timer. I've checked everything and it seems I've done nothing incorrectly. I wonder if this is even going to work...
 

Gravidea

L5: Dapper Member
Apr 17, 2017
227
102
Use PlaySound. ToggleSound will stop the sound if it is already playing, which may break things.
Thank you for your help. It seems I've found the solution. I need to add another logic trigger that does a "StopSound" a second before the other timer plays it. It works perfectly now.
 

henke37

aa
Sep 23, 2011
2,075
515
I recommend switching to a logic_case setup. That way you can build a playlist of songs and even have a shuffle mode.