AudioSettings.dspTime and Native UnityAudioEffectState->currdsptick sometimes out of sync

Most of the time I can sync an audio clip to my native plugin by using AudioSettings.dspTime in C# and UnityAudioEffectState->currdsptick in Native code.

However, sometimes these get out of sync. It seems like the AudioSettings.dspTime freezes when the game is put in the background but the UnityAudioEffectState->currdsptick keeps running.

Anyone have any experience syncing C# audio to Native?

@mtytel have you tried having ‘Run in Background’ checked in the Player Settings ?
That’s the only way to have it advance afaik.

@r618 Yeah that would probably work, thanks. I would still like to find a solution that doesn’t require modifying player settings because I’m releasing these as assets.
I guess I could give a warning or something…