Synchronizing device sounds with animation

Device sounds in Flash Lite are always treated as event sounds. This means that you can’t synchronize device sounds with animation in the timeline in the same manner that you can with native Flash sounds. However, you can use device sounds to approximate true synchronized sound by setting the Flash Lite player’s _forceframerate property to true. When this property is set to true, Flash Lite drops frames from animation to maintain the SWF file’s specified frame rate. As long as the device sound data is authored for the correct duration, and as long as the device plays back sound data at the expected rate, animation and sound will be close to being synchronized.

For example, suppose you have a device sound that’s 5 seconds long. During playback, you’d like this sound to play in synch with animation in the timeline. Also assume that your application’s frame rate is set to 15 FPS. When you start the sound—either by attaching it to a frame in the timeline or calling Sound.start()—you simultaneously set _forceframerate = "true". Subsequently, for each second of device audio playback, Flash Lite ensures that the playback head has advanced 15 frames in the timeline. If, for some reason, the player cannot render each frame in the animation during this time, it drops frames to maintain the specified frame rate.

For more information about the _forceframerate property, see _forceframerateproperty in the Flash Lite 2.x and 3.0 ActionScript Language Reference.