Skip to main content
Participant
October 15, 2011
Question

Lip synchronization: image refreshing speed

  • October 15, 2011
  • 1 reply
  • 325 views

Hi,

I am creating an application in which the mouth positon of a cartoon character is automatically synchronized to an audio file.

I have an automatically generated XML file (usin an automatic speech recognizer) which contains the phonemes ('letter sounds') and the start times of these phonemes in milliseconds.

When I start playing the audio file, I also start a timer which dispatches an event every 30ms and using this event I update the mouth image (PNG).

This seems to be working fine partially: When I trace the phonemes at the times they should occur following the XML file they seem to stay in sync with the speech.

However, if I also switch the image containing the mouth position, it seems that that the mouth image is not updating correctly (not fast enough and with glitches).

I think this has to do with the fact that I use Flex and the Image control. I just change the source of the Image to the (local) file.

Is there any better way to do this? For example using the Bitmap class or some clever trick using the 'visible' property?

This topic has been closed for replies.

1 reply

Inspiring
October 15, 2011

Sound never plays in sync with Flash frames unless sound is placed on timeline. Thus, it is difficult to make it perfect.

What you may want to try is:

1. Read SoundChannel position and rely on it (if you don't do it yet).

2. Display image 30 seconds ahead. Flash redraws screen at the end of current frame - hence what user sees is what related to sound playhead position frame interval before. If you update force screen rendering with timer - the same applies.