How are sounds played by the Roblox Engine? How can I emulate them?

I am creating a play sound at time script. Thing is there is a strange and complicated process to doing this as I have been planning for.

Here’s the problem:

Imagine I have a very laggy frame, a full 3 second single frame. And this frame runs from t=2 to t=5.

And in that time I have a Klaxon alarm that’s scheduled to come online at t=3.
image
And the light and the sound are supposed to be synced.

If I just :Play() whatever sounds are in the cache for each frame, i.e: play whatever sounds had their start times past by the last frame, than this would lead to de-sync.

If I set Sound.TimePosition to the positive difference of the the added up frame times and the start sound times, then I fix the de-sync. Yay!

But does Roblox do that? I think yes for big lag gaps it has to, or joining a game when a sound is already playing. But what about normal operations, 60FPS, .01333 second deltas? When a sound plays, the TimePosition could be bumped as much as that tiny amount of the whole tiny frame! In normal operations!
Would we notice that; do we notice that!?
Do you think Roblox does, and therefore I should, leave a little amount of lenience for such de-sync, that is so tiny it is not worth adjusting? Or is the benefit of slightly better de-sync worth the odds of losing the first minutial moments of the sound?
That’s what this comes down to. Is losing the first <=.013s of a sound more a loss than a equivalent <=.013s de-sync?

Don’t answer with nuance;it comes down to the case!, please. Pick one, because I have too get off the fence eventually now don’t I? :slightly_smiling_face:

2 Likes