|
How streaming works
Streaming refers to the normal flow of data as it travels to someone's desktop computer from a server through a network connection. The speed at which data moves is limited by the network connection. The typical connection for most users is a modem running at 28.8Kbps per second or slower.
All data moving to a user's machine over a network connection is streamed. What makes a Flash movie stream differently than text, GIF, or JPEG files, for example, is that the data in a Flash movie file is stored sequentially by frame. As soon as the Flash Player receives all of the data for a single frame of a Flash movie, the Player immediately renders that frame to the screen without waiting for any more of the movie's data to arrive.
How Flash stores image data
To understand streaming, it helps to understand how Flash stores data. Image data and sound data are stored somewhat differently. Image data in Flash consists of a set of coordinate values for each curve and fill that comprises the image. Flash stores the image data for any graphic that is not converted to a symbol, a bitmap, or text in each and every frame in which the graphic appears. The image data for a graphic that is converted to a symbol is stored in the first key frame in which the symbol appears. Subsequent frames using that symbol don't store the image data for that symbol. Rather, each subsequent frame merely references the symbol's data from the key frame in which it first appears and stores only information about changes in position, rotation, scale or color that occur to the symbol in that frame. Bitmaps and text data are similarly stored in the first frame in which they appear. Animated symbols are an exception to this rule. All the data of an animated symbol is stored in each frame.
How Flash stores sound data
Sound is stored in Flash in one of two ways. Event sounds, such as button clicks, are stored in much the same way as symbols. Once they appear in a keyframe, their data is simply referenced by later keyframes that use that sound and only changes to the sound are stored in subsequent keyframes. For streaming sounds, Flash portions out small chunks of the streamed sound and saves one of these chunks in each of the frames in the range of frames over which the sound is played. These sound chunks are reconstituted into a single audio stream as the movie plays.
How compression affects streaming of sound
Compression strategies for sound make streaming sound slightly different from streaming image data. Images are uncompressed once. Sound needs to be uncompressed as fast as the sound plays, every time it plays. Experimenting with different compression strategies for each of the sounds in your movie can help you make the choices between quality and performance that work best for the effects you want to achieve with sound.
Use the following table as a guideline to make compression choices for the sounds in your movie:
| 5 kHZ |
2-3 bit compression |
acceptable for speech |
| 5 kHZ |
4-5 bit compression |
acceptable for button sounds |
| 11 kHZ |
4-5 bit compression |
good quality speech |
| 11 kHZ |
2-3 bit compression |
acceptable to music |
| 11 kHZ |
no compression |
best for music without creating large file/long download times |
Outputting sounds at sampling rates above 11 kHZ begin to push the file size limits. If sound is the most important feature of your movie sampling rates of 22 kHZ can be used but be aware that downloading sounds at high sampling rates can be very slow for the average 28.8 modem connection.
Notice that the degree to which each setting affects file size displays underneath the Rate and Compression fields in the Sound Properties dialog box whenever you change either settings. The Test button in the Sound Properties dialog box lets you hear your sound with the rate and compression settings applied to it. Use these two features together to help guide you in making your rate and compression choices.
Note: The compression settings you apply to each individual sound in the Sound Properties dialog box override any rate or compression settings you might choose in the Export Shockwave Flash dialog box. This allows you to use different compression settings for each sound you use.
|