Detect when an Audio Cue Loops

Okay, So i did some exploring and came up with this method. It’s pretty hacky. but it does work. If anyone has a better idea. Do let me know! But for now I will use this.

Hey All, I have a fairly simple issue here.

I have dynamic music in my game that is formed by a sequence of seamless loops. I want to influence the game-play when the music loops.

Because everything is meant to be in time with the music, I want a tick to fire each time the Music loops.

I nearly had it, when I disabled looping on my sound cue, and had and event bound to when the music stops, and then set it to play again when this event fired. But I end up with this horrible obvious gap in the music.

All i want is to be able to detect when my looping music restarts, I feel like I have to have it set the looping to alleviate the nasty gaps I get.

Any thoughts?

Maybe play the looped version of your sound ( so there’s no nasty jump ), but then also set a timer for loop length. When you get to the end, re-spawn the sound, and kill the old one once the new one is playing…

I don’t think there is a perfect way to do it.

OR: Have another sound you can play to cover up the gap while it happens.

Only thing with a timer is it falls out of sync with the music. Even though I’ve found that my method above always triggers just before the loop as opposed to directly on it, that works quite well for me because I can add aspects to the music so it’s ready to be looped right when it starts. Might not be great for someone who is looking for something more accurate, but I think I’ll stick to this one for now.
Still I’ll leave the thread open just in case anyone wants to suggest more :slight_smile:

Make the timer slightly shorter than the music. When it triggers, start the music again ( with the cover up ) and make a new timer.

I dunno what u wanna do exactly, use timer if events are not fit for u.
322424-
if u still hear the gap (uuum it depends your needs and soundwaves), I suggest you to have two audio sources, so that instead of instant stop and play, u fadeout the first source, then fadein/play the second source.

btw I guess Switch node in SoundCue might be useful as well :slight_smile: