Jump to content

Fixed animation frame rate


Ulfheden
 Share

Recommended Posts

Hi,

I have a speech animation for a character and an audio clip for this speech. When having the animation and audio start at the same time, however, there's a delay that makes the first 30 frames of the animation (it's in 30 fps, so the first second) take 1.5 s, but the next 30 frames, i.e. the next second, take around a second. So, it's clear that the frame rate is variable.

To synchronize the animation with the audio, rather than doing some hack like inserting a 0.5 s delay on the animation (which likely won't work universally since I imagine this delay will vary from machine to machine and even depending on system load), I'd like to not just set a maximum frame rate as the current API allows me to, but also a minimum one, i.e. lock it to 30 fps. If the engine can't do 30 fps in one instance because of system load etc., then it should simply skip those frames, rather than slowing the entire animation down.

Is there any such feature? I can't find any audio-related examples at all...

Thanks!

Link to comment
Share on other sites

1 hour ago, Deltakosh said:

This is what should have happened :( The animation is skipping frame and does not slow down animation. Can you provide a repro of this issue in the Playground?

Oh, my bad, sorry! Thanks for the quick answer, since it made me rule out that there was any variable frame rate thing going on. Thanks to the animation tutorial page, I found the frame event listener. I used that to measure time earlier for the opening post, but never inserted one for frame 0, just frames 30 and 60, because I assumed the animations would start immediately (and thus started the timer there), but I was wrong. In my case, there's a 500 ms gap between the beginAnimation call and the actual start of frame 0. Now I start the audio clip at frame 0 instead and everything works as expected :)    FYI, the time measurement is correct now also, both seconds of the animation are at ~30 fps +- 0.8 or so.

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...