simple mouth movement animation does nothing

I did the best I could to:

  1. reduce your code to a module.  Got rid of scene as that wasn’t needed for this example.

  2. Showed two different ways to step animation.

Download this: https://github.com/roaminggamer/RG_FreeStuff/raw/master/AskEd/2018/02/Anim.zip

Look in folder: Anim_modified

In case it wasn’t clear, the third example cannot be aligned to the times you want, because the animation can only be changed on each new game frame (not to be confused with a animation frame).

Each game frame is either ~17 ms apart or ~33ms apart, but they WILL vary.

The ONLY true way to get a consistent timed animation like you want it to actually make the animation artwork play that way and have a sequence be composed of multiple-frames. 

In short, it ain’t easy to get animations that perfectly align with speech.  However, you may find your approach is just ‘good enough’.

Ah, I see. Thank you so much, I think I understand now. The alignment is of course difficult, mostly because of the delay in audio.play startup (I do audio.load() ahead), but all my phrases are quite short, and it works out pretty well with the repeating frame technique. The phoneme breakdown (Papagayo) can be set for any frames/sec, gives me the starting frame number for each phoneme, and I multiply the ms/frame through, and it works out pretty well.

Thank you for your help. It is working well now.