AudioSource.time update intervals

So I’ve split a .wav file into two parts: an intro, and then a looping section. Obviously, I want to play the loop immediately following the intro, and for it to be seamless.

I’m not sure if there’s an easier way to do this, but I thought that I’d just check to see if the intro is within 0.0167 (1/60) seconds from the end, and then play the loop file. This didn’t always seem to work properly, and is dependent on framerate, so I moved the logic into FixedUpdate().

No matter how fast FixedUpdate runs, however, audioSource.time and audioSource.timeSamples do NOT update at those speeds. If FixedUpdate is 0.007s, for instance, I usually get three consecutive values of the same number.

Does anyone have any tips for seamless playback here? Not finding many good solutions online.

You want to use AudioSource.PlayScheduled to play your sound in the future. You can compute exactly how long in the future based on where the current track is and when it ends.