Previous Page
Next Page

Getting Tips on Production

The primary goal of sound optimization for limited delivery networks (such as the Internet) is to deliver an acceptable quality without a large file-size "cost." You should be concerned about the file size of your audio clips for several reasons:

When you're working with audio clips, it's important to create the shortest audio clips possible. That means trimming off any excess sound that you don't need, especially any blank lead-in or lead-out handles (also called in and out points) at either the beginning or the end of a clip.

Cross-Reference 

We discuss trimming excess sound briefly in Chapter 15, "Adding Sound," with reference to Flash's sound tools. We explain the topic in greater detail in the archived chapter, "Working with Audio Applications," found at www.flashsupport.com/archive.

If you plan to have a background music track in your Flash project, it's a good idea to use a small audio clip that can be looped.

We describe looping audio clips in Chapter 15, "Adding Sound."

Cross-Reference 

Here is a simple formula to determine the file size, in bytes of a given audio clip:

Seconds of audio × sample rate × # of channels × (bit depth ÷ 8) = file size
Note 

In the preceding formula, the sample rate is expressed in Hz (hertz), not kHz (kilohertz). The bit depth is divided by 8 because there are 8 bits per byte.

Thus, a 20-second stereo audio loop at 8 bits, 11 kHz would be calculated like this:

20 sec × 11,025 Hz × 2 channels × (8 bits ÷ 8 bits/byte) = 441,000 bytes = 430KB

There are two schools of thought regarding the ideal quality of sound files for import into Flash. These schools are pretty much divided into those who have high-end sound-editing tools and those who don't. In an effort to delineate the best path for each group, we've noted the following:

Web Resource 

For more information on high-end sound tools, refer to the archived Macromedia Flash MX 2004 Bible (Wiley, 2004) chapter, "Working with Audio Applications," at www.flashsupport.com/archive. As with so many things, individual mileage may vary.

You should always keep in mind that Flash can retain imported MP3 compression settings only with those MP3 files that will be used for non-Stream sync options. Anytime you set a sound to use Stream sync on a timeline, Flash needs to recompress the file with the Stream export settings found in the Publish Settings dialog box.

Finally, all linked sounds, or those set to export from the Library and played back via ActionScript, are treated as non-Stream sounds. If you use linked sounds, you may find it use ful to import precompressed MP3 files at your preferred bit rate. Flash will not recompress the MP3 file upon export to an .swf file.


Previous Page
Next Page