setTimelinePosition and getTimelinePosition

I set the timeline position and get it back immediately but they appear to be different, it’s about 0.2s off. Any idea why?

When you set the timeline position, internally we create a command that will execute during the next asynchronous Studio update, when you query the timeline position you get the last actual playback position (not the previously set value), might that explain the difference you are seeing?

Oh I see. I notice that the the timeline position keeps at 0 during the first 100~200ms after I called myevent.start(). Is their a way to figure out the exact delay?

Oh I got it. It’s because the asset is streaming. Without streaming the delay is negligible.

Hi,

Regarding the getTimelinePosition() API call I did try to print and see the audio time but in Unity for a few consecutive frames I get the same value for audio time. I actually wanted to get the exact timeline position each frame.

We are using FMOD for our rythm based game in Unity and hence needed an accurate timeline postion.

Audio time doesn’t move smoothly, it’s updated in chunks of DSP buffer size. So if your DSP buffer size is 1024 samples and your sample rate is 48kHz, then the smallest non-zero difference you’ll see between polls is ~21ms.

You could reduce your buffer size to 512 samples @ 48kHz to get ~10ms increments.