Macromedia Flash 8 for Windows & Macintosh

Stream 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, stream 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.

To make an assigned sound a stream sound

1.

Open a new copy of the SoundSyncTemplate that you created earlier in this chapter.

2.

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

3.

In the Timeline, in the Sound 1 layer, select keyframe 5.

4.

In the Frame Properties tab of the Property inspector, from the Sound pop-up menu, choose Scale.AIFF.

5.

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

Figure 15.19. To make Flash force a sound to synchronize with specific frames of your movie, choose Stream from the Sync pop-up menu in the Frame Properties tab of the Property inspector.

6.

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

The Edit Envelope window appears.

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 subclip with a specific frame of the movie. If the sound plays back faster than the computer can draw frames, Flash sacrifices some visuals (skips drawing some frames of the animation) so that sound and images match up as closely as possible. Setting a sound's Sync setting to Stream ensures, for example, that you hear the door slam when you see it swing shutnot a few seconds before. If the discrepancy between sound-playback speed and frame-drawing speed is 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.

At 15.8 seconds, the Scale.AIFF sound is too long to play completely in the frames between keyframe 5 and keyframe 15. 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 15.20).

Figure 15.20. 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 there are for the sound to play in. In the Frame Properties tab of the Property inspector, click the 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.

7.

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

The truncated waveform appears in frames 515 (Figure 15.21).

Figure 15.21. There is time enough in the 10-frame span from keyframe 5 to 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.

8.

Position the playhead in keyframe 1, and play your movie to hear the sound in action. When the playhead reaches keyframe 5, the Scale.AIFF sound starts. When the playhead reaches keyframe 15, the keyframe span ends, and Flash stops playback of the Scale.AIFF sound.

9.

Choose Control > Loop Playback, and then play the movie to hear the sound in looping mode.

Flash repeats the same snippet of sound, stopping it each time the playhead reaches keyframe 15.

Tips

  • You can hear streaming sounds play as you drag the playhead through the Timeline (a technique called scrubbing). 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 onscreen.

  • Try Shift-clicking the Timeline to take the playhead to a particular frame (or Shift-dragging the playhead to that frame). As long as you hold down the Shift key and the mouse button, Flash repeats the portion of sound that synchronizes with the frame where the playhead is.

  • If your stream 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 15.22).

    Figure 15.22. 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 you need to provide enough time for the major parts of the sound to finish. (For this sound, you would need 15 frames.) Usually, you want to make room for the segments of the wave that have the greatest amplitude.

Категории