This content has been marked as final. Show 2 replies
You cannot synchronize assets using the score and relying on a frame to
require an exact number of milliseconds for display. The Tempo channel
provides a target frame rate that won't be exceeded but is not
guaranteed to be matched.
I suggest you look at cuePoints, or poll sound().currentTime from a
regular event like #enterFrame
To get reasonably synced free run animation, the frame rate would be
have to be set to a rate that he slowest end user system can play at,
'throttling back' the frame rate prevents faster systems from
overrunning the sound track.
More serious syncing requires some more exact sync scheme.
Usually this involves shortening the number of score frames a bit, then
inserting score scripts or tempo channels that hold on a frame until a
certain sound time is reached.
Embedding cue points in the sound files in advance allows a simple tempo
channel setting or more sophisticated lingo method to hold a frame until
the designated cue point comes up. Tempo channel settings hae a problem
with locking out user interface responce while in a wait condition.
An alternative to embedded cue points (that can only be set with a
couple of sound editors) One can create a cue times list that is stored
in a field member. Here's an untested example of how a score script
could use the cue times field.
-- start of sound sequence frame
currentCue = 0
-- score script placed in sequence at each hold frame.
global currentCue, currentCueTime
currentCue = currentCue + 1
currentCueTime = value(field("cueTimeList").line[currentCue])
if sound(2).currentTime <= currentCueTime then go to the frame -- wait