Lip synchronization: image refreshing speed
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?