Using Streaming Sounds

I l @ ve RuBoard

Streaming sounds are specifically geared for playback over the Web. When Sync is set to Stream, Flash breaks a sound into smaller sound clips. Flash synchronizes these subclips with specific frames of the movieas many frames as are required to play the sound. Flash stops streaming sounds when playback reaches a new keyframe or an instruction to stop playing either that specific sound or all sounds.

Unlike event sounds, which must download fully before they can play, streaming sounds can start playing after a few frames have downloaded. This situation makes streaming the best choice for long sounds, especially if you'll be delivering your movie over the Web.

The Mystery of Streaming Sound

When you choose Stream as the Sync setting for a sound, Flash divides that sound clip into smaller subclips and embeds them in individual frames. The movie's frame rate determines the subclips' size . In a movie with a frame rate of 10 frames per second (fps), for example, Flash divides streaming sounds into subclips that are a tenth of a second long. For every 10 frames, Flash plays 1 second of the sound.

Flash synchronizes the start of each sub-clip with a specific frame of the movie. If the sound plays back faster than the computer can draw frames, Flash sacrifices some visuals (doesn't draw some frames of the animation) so that sound and images match up as closely as possible. Streaming sound ensures, for example, that you hear the door slam when you see it swing shut not a few seconds before. If the discrepancy between sound-playback speed and frame-drawing speed gets big enough, however, those dropped frames make the movie look jerky, just as it would if you set a low frame rate to begin with.

To make an assigned sound a streaming sound:

  1. Open a new copy of the SoundSync Template that you created earlier in this chapter. (Choose File > New From Template.)

  2. In the Timeline, in the Sound 1 layer, remove keyframe status from Frame 10 (select it and choose Insert > Clear Keyframe).

  3. In the Timeline, in the Sound 1 layer, select Keyframe 5.

  4. In the Frame Property Inspector, from the Sound pop-up menu, choose Scale.

  5. From the Sync pop-up menu, choose Stream (Figure 14.25).

    Figure 14.25. To make Flash force a sound to synchronize with specific frames of your movie, choose Stream from the Frame Property Inspector's Sync pop-up menu.

    graphics/14fig25.gif

  6. To see how the sound fits into the available time in your movie, in the Sound section of the Frame Property Inspector, click the Edit button.

    The Edit Envelope window appears.

    At 15.8 seconds, the Scale sound is too long to play completely in the frames between Keyframe 5 and Keyframe 10. When Sync is set to Stream, Flash plays only as much of the sound as can fit in the frames that are available to itin this case, slightly less than a second. In the Edit Envelope window, a vertical line indicates where Flash truncates this instance of the sound (Figure 14.26).

    Figure 14.26. When you set a sound's Sync to Stream, you can check how much of the sound will play, given the number of in-between frames your movie has for the sound to play in. Click the Frame Property Inspector's Edit button (top) to open the Edit Envelope window (bottom). This window displays a sound's full waveform in relation to time or to frame numbers .

    graphics/14fig26.gif

  7. To close the Edit Envelope window, click OK or Cancel.

    The truncated waveform appears in frames 5 through 15 (Figure 14.27).

    Figure 14.27. There is time enough in the 10 frames between Keyframe 5 and Keyframe 15 to play only the first note of the Scale sound. Flash displays just that much of the full 15.8-second waveform in the Timeline.

    graphics/14fig27.gif

  8. Position the playhead in Frame 1, and play your movie to hear the sound in action.

    When the playhead reaches Frame 5, the Scale sound starts. When the playhead reaches Frame 15, the keyframe span ends, and Flash stops playback of the Scale sound.

  9. Choose Control > Test Movie to hear the sound in looping mode.

    Flash simply repeats the same snippet of sound, stopping it each time the movie reaches Frame 15.

graphics/01icon02.gif Tips

  • You can hear streaming sounds play as you drag the playhead through the Timeline (a technique called scrubbing in audio circles). As the playhead moves over the waveform, you can see how the images and sounds fit together. You can then add or delete frames to better synchronize the sounds with the images on-screen.

  • Shift-click the Timeline to take the playhead to a particular frame (or Shift-drag the playhead to that frame). As long as you hold down the mouse button, Flash repeats the portion of sound that synchronizes with that frame.

  • If you find that your streaming sound is getting cut off too soon, switch the units of measure in the Edit Envelope window to see how many frames you need to add to accommodate the sound (Figure 14.28).

    Figure 14.28. The scale for the waveform in the Edit Envelope window can be set to seconds (top) or frames (bottom). If you set the scale to frames, you can see exactly how many frames the movie needs to provide enough time for the major parts of the sound to finish. (For this sound, you would need 25 frames.) Usually, you want to make room for the segments of the wave that have the greatest amplitude.

    graphics/14fig28.gif


I l @ ve RuBoard


Macromedia Flash MX for Windows and Macintosh. Visual QuickStart Guide
Macromedia Flash MX 2004 for Windows and Macintosh (Visual QuickStart Guides)
ISBN: 0582851165
EAN: 2147483647
Year: 2002
Pages: 243

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