Synchronizing Audio to Animations


In film editors' lingo, to synchronize, or sync, means to precisely match picture to sound. In Flash, sound can be synchronized to the visual content of the timeline. Flash sync affords several options for the manner in which the audio clip is related to graphics or animation on the timeline. Each of these sync options is appropriate for particular uses, which the following sections discuss.

The Sync options in the sound area of the Property inspector control the behavior of sound in Flash movies, relative to the timeline in which the sound is placed. The Sync option you choose depends on whether your sound is intended to add dimension to a complex multimedia presentation or to add interactivity in the form of button-triggered sound, or whether it is intended to be the closely timed soundtrack of an animated cartoon.

Event

Event is the default Sync option for all sounds in Flash, so unless you change this default to one of the other options, the sound automatically behaves as an Event sound. Event sounds begin with the keyframe in which they occur and then play independently of the timeline. If an Event sound's duration is longer than the remaining frames of its timeline, it continues to play even though playback on the timeline has stopped. If an Event sound requires considerable time to load, the movie pauses at that keyframe until the sound has loaded completely. Event sounds are the easiest to implement and are useful for background sound scapes and other sounds that don't need to be synced. Again, Event is the default Sync setting in the Sound menu of the Property inspector.

Caution 

Event sounds can degrade into a disturbing inharmonious round of out-of-tune sound loops. If the timeline holding the Event sound loops before the sound has completed, the sound begins again — over the top of the initial sound that has not finished playing. After several loops, the resulting effect can become intolerable. To avoid this effect, use the Start Sync option.

Start

The Start Sync option is similar to an Event option, but with one crucial difference: If any instance of that sound is already playing, then no other instance of that sound can play. In other words, the Start Sync option tells the sound to begin playing only if other instances have finished playing or if it's the first instance of that sound to play. This option is useful if you want to avoid the layering problem we discussed in the previous caution note for Event sounds.

Note 

Start sounds are actually a type of Event sound. Later in this chapter, when we refer to Audio Stream and Audio Event settings in the Publish Settings dialog box, realize that Start sounds belong to the Audio Event category.

Stop

The Stop Sync option is similar to the Start Sync option, except that any and all instances of the selected sound stop playing when the frame containing the Stop Sync option is played. This option comes in handy when you want to mute a specific sound in a crowd of others. For example, if you created a sound mixer with an arrangement of Button instances, you could assign the Stop Sync option to a mute button for each of the sounds in the mixer.

Stream

Stream sounds are similar to a traditional soundtrack in a video-editing application. A Stream sound locks to the timeline and has priority over visual content. When you choose a Stream sound, the Flash Player attempts to pace the animation in sync with the sound. However, when animations either get too complex or are run on slower machines, the Flash Player skips — or drops — the frames as needed to stay in sync with the Stream sound. A Stream sound stops when the Playhead reaches the last frame that includes the waveform of the Stream sound; likewise, a Stream sound pauses if the timeline containing the Stream sound is stopped. A Stream sound can be scrubbed; by dragging the Playhead along the layer's frames in the Timeline window, the Stream sound plays in direct relationship to the content as it appears, frame by frame. This is especially useful for lip-sync and coordinating the perfect timing of sound effects with visual events.

To use sound effectively, it's important to understand how Stream sounds work. When a Flash document is published as a Flash movie file (.swf) and the Sync option for a sound is set to Stream, Flash breaks the sound into chunks that are tied to the timeline. The bytes within the movie are arranged according to the linear order of the Main Timeline (that is, Scene 1). As such, if you have a Stream sound that stretches from frames 1 to 100 of the Main Timeline and the movie contains a total of 200 frames, the Stream sound's bytes will be evenly distributed over the first 50 percent of the file's bytes.

Tip 

When adding sounds to the timeline, no matter how many times you tell a Stream sound to loop, a Stream sound will stop playing wherever the visual waveform in the Timeline window ends. To extend a Stream sound's duration, add as many frames as necessary to a Stream sound's layer.




Macromedia Flash 8 Bible
Macromedia Flash8 Bible
ISBN: 0471746762
EAN: 2147483647
Year: 2006
Pages: 395

flylib.com © 2008-2017.
If you may any questions please contact us: flylib@qtcs.net