MV Setting up a conditional branch checking audio position with millisecond accuracy.

Hey, all. Something I've been curious about would help me creating timed cutscenes. In my visual novel, I use show picture + play BGM commands to show cutscenes with visuals timed to the music (using standard show picture commands), but some players have noted that sometimes, the two can get desynced, leading to visuals lagging behind audio.

I'm curious if there's a native JS function that can be used to check if a certain position has been reached in the music to with higher accuracy than a second (millisecond, hundredth of a second) or even just a way of converting the current audio position for a BGM or BGS track to something more accurate than the last second elapsed. Googling it, I've seen code that reads 'pos' from the audiobuffer, but only in whole seconds. Thank you!
It's that AudioManager._bgmBuffer.seek() stuff. It gives you a value with lots of decimals. You can check it in console.
Okay, I feel like an idiot now. I did indeed try that script call by setting it as a variable, as others suggested in previous threads, but didn't realize that the reason that the engine was converting the number to an integer automatically. I've used variables to store strings, so I'd forgotten it had that behaviour for numbers. 1000*AudioManager._bgmBuffer.seek() gives me the result in milliseconds.

Thanks very much for the help! The thread can be closed.

This thread is being closed, due to being solved. If for some reason you would like this thread re-opened, please report this post and leave a message why. Thank you.

Original thread: https://forums.rpgmakerweb.com/threads/setting-up-a-conditional-branch-checking-audio-position-with-millisecond-accuracy.181339/