Syncing animations with audio

Monkey Forums/Monkey Programming/Syncing animations with audio

Fedor(Posted 2015) [#1]
Is it possible to find out at what point a specific audio or music piece is playing at any moment? Is there some sort of native 'getCurrentPosition' function?

I need it to sync animations with spoken text and I would rather use a native feature of Monkey then some 3rd party library.


Nobuyuki(Posted 2015) [#2]
no, but you can get pretty close by taking a snapshot of Millisecs() at the time the sound event is triggered and checking how much time has elapsed since then. Depending on how long it takes for the sound to trigger and how fast your update rate is will determine how close you get to total accuracy. It should be good enough for most things related to simple animations, but it won't be good enough for things like music generation or complex rhythm games.