Layering Sounds in Flash


You can layer looped event sounds in Flash and apply effects to different segments of the looped sounds to get a fair amount of variety for relatively little overhead. If you're just synchronizing sounds, you can divide your sounds into tracks or layers and loop each sound all the way across the timeline. You then can fade in, fade out, and otherwise manipulate the loops using Flash's custom sound editing controls. If you choose to bring the sounds in at different frames , or if you're trying to synchronize a long-playing sound and animation, you'll have to resort to streaming your sound.

In either case, the first thing you want to do is make sure that all the sounds that you want to synchronize are recorded at the same tempo, in this case, a specific number of beats per minute. If you don't do this, you're never going to have happy results. There are a number of sound editing programs out there that let you import a sound, set a tempo for it, and export it as a WAV or AIFF file. If you are unsure of the tempo of the sound you are importing, it's a good idea to check it and reset it in one of these programs. Sonic Foundry's Acid Pro for Windows or Macromedia's Sound Edit 16 for the Macintosh are popular choices.

Now that you know the basics for creating a layered soundtrack, let's give it a try.

Exercise 13.1 Creating a Layered Soundtrack

Creating a layered soundtrack in Flash isn't difficult, as long as you start with some good building blocks. Make sure all the sounds that you are trying to synchronize are recorded at the same number of beats per minute.

  1. Create a new movie and import the following sounds from the Chapter_13/ Assets folder (Windows users use the WAV files; Macintosh users use the AIFF files):

    • claps

    • highhats

    • guitar

  2. Create a layer for each sound ( name your layers appropriately) and drag an instance of each sound onto the Stage. Don't make me say itput them in the appropriate layers.

  3. Save your file as sound.fla, publish your movie, and take a quick look at the file size of the SWF file. It should be about 26KB.

  4. Use the guitar sound as your base sound. Open the Sound panel, choose guitar.wav, and set it to loop 4 times. Extend the frames in all layers until you can see the entire waveform for the guitar sound (about 230 frames). If you're not streaming the sound, you don't actually have to do this, but it does enable you to see your waveform. (See Figure 13.3.)

    Figure 13.3. After you've imported sounds into your Library, you have to place them on the Stage in the appropriate layers. If you extend your timeline, you can see the complete waveforms.

    graphics/13fig03.gif

  5. Loop the rest of your sounds until they also extend the entire length of the timeline.

  6. Save your file and test your movie. Check your file size again. You should see only a miniscule increase in file size and that's due to adding extra frames, not looping the sound.

You've layered your sound and depending on your processor, it might sound okay or it might sound out of synchronization. Don't worry about that; it's a continuous annoying loop. You'll be fixing that shortly. First, you set up the layered sound you already have so that it plays back more predictably.



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