Synchronizing Layered Sounds


Even though all your sounds start on the same frame, playback is not always predictable. Logically, you'd expect the sounds to play back in perfect synchronization; after all, that's how you placed them on the Stage. That's not always what happens, however. Depending on the capabilities of the computer on which the sound is being played back, some of the sounds might not begin playback at precisely the same rate or time. This gives your soundtrack an "off" sound. Staggering the introduction of sounds, even sounds recorded at exactly the same rate, is even more problematic . Remember that an event sound has to download completely before it can start to play, so unless you've preloaded your sounds, there will be a lag before the sound starts to play.

There are a variety of ways you can approach this problem. You could set one of the sounds to stream. That would serve to lock the rate at which the movie plays back. That'll work, sort of. You'll most likely hear degradation in the quality of whichever track you stream. You'll definitely get an increase in your file size. If you're going to take a hit in file size for streaming, why not do it in such a way that your overall sound quality doesn't suffer?

Fortunately, there's a handy little trick you can use to accomplish this. All you need is a very short, low-quality sound that has been recorded at the same tempo as the rest of your sounds. It doesn't particularly matter what the sound is; you're going to mute it anyway. After you have the sound, you're going to do exactly what you were told not to do a few sections agoyou're going to loop the sound and set the synchronization to stream. Yes, this increases your file size. However, because you never actually hear the additional sound, you don't have to worry about the quality of the sound degrading while streaming. In addition, it serves to lock down your timeline so that all the music plays back in synchronization.

Exercise 13.2 Synchronizing Sounds in Layers

To get predictable playback of sound, you need to lock your timeline. You do that by inserting a streaming layer.

  1. Open sound.fla, if it isn't already open, or if you're starting the exercises at this point, open sound1.fla from the CD.

  2. Add a new layer at the top of the stack, and name it Streaming.

  3. From the Chapter_13/Assets folder, import the Click sound (WAV for PC users, AIFF for Mac users).

  4. With the Streaming layer selected, drag the Click sound onto the Stage.

  5. Open the Sound panel. Make sure the Click sound is selected, and press the Edit button.

  6. For both channels, drag the envelope handles to the bottom of the Channel window to mute the sound, and then click OK. (See Figure 13.4.)

    Figure 13.4. To mute a sound, open the Edit Envelope window and drag the Envelope handles for both channels to the bottom of their respective windows .

    graphics/13fig04.gif

  7. Back on the Sound panel, set Sync to Stream. Set Loop to 4.

  8. To ensure that the synchronization is properly set, select frame 1 of each of the sound layers, except for Streaming, and drag the starting frame to frame 3. (See Figure 13.5.)

    Figure 13.5. It's usually a good idea to start your streaming sound a couple frames before your nonstreaming sounds.

    graphics/13fig05.gif

  9. Save and test your movie. Now your movie should play back predictably on any machine.

Tip

Starting the streaming sound a few frames before the rest of your sounds helps to lock the timeline.


You get another chance to practice using a streaming track a little later when you learn how to synchronize a spoken soundtrack to animation. Before you do that, however, take some time and learn how to customize the soundtrack you have.

Note

On a PC, you can create a layered track in Flash and export it as a WAV file. You then can import and work with the single sound rather than with layers (File > Export Movie > WAV Audio). Unfortunately, there isn't an equivalent export on a Macintosh.




Inside Flash
Inside Flash MX (2nd Edition) (Inside (New Riders))
ISBN: 0735712549
EAN: 2147483647
Year: 2005
Pages: 257
Authors: Jody Keating

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