Audio desyncing on focus lost / output device disconnected

As the title says, audio gets desynced when the app loses focus (on mobile iOS) or when a audio device is disconnected (like a headphone), this causes the audio to desync with the timeposition property since roblox has to stop the audio (for example on focus lost on mobile) and then resume it but the property doesnt have the correct value.

Here’s the bug happening on an apple device after the widget tray was opened, the game (Project: Afternight [INDEV] - Roblox) uses sound.TimePosition on BindToRenderStep (Priority: Input + 10) to sync the notes with the audio so the chart is played in sync, however TimePosition gets desynced whenever roblox has to pause the audio internally (app focus lost or output device change)

(Another video comparing the desync)

Here’s a place file where the bug can be replicated, it wont happens through studio audio mute feature, but still happens if you unplug and plug an output device.
soundDesync.rbxl (60.8 KB)

4 Likes

This is just an acknowledgment announcement!

We’ve filed a ticket to our internal database, and we’ll follow up when we have an update!

Thanks for the report!

2 Likes

Are there any updates on this issue? This audio bug still persists to this day even with the new audio API. It’s not rare to come across this bug, I experience it anytime the game loses focus, like getting calls or notifications, going into the iOS control or notification centers, or getting a low battery warning, at least one of these happens most times when I play a Roblox experience. I thought of creating a makeshift solution with the UserInputService.WindowFocused event, but it does not fire on the iOS devices that I’ve tested with. It would make it easier to develop experiences with timed audio events for iOS if this audio desyncing bug was addressed.

3 Likes