Macromedia Flash8 Bible

To take a global approach to the control of audio output quality, choose File ð Publish Settings (Ctrl+Shift+F12 or Shift+Option+F12) to access the Publish Settings dialog box. Then choose the Flash tab of the Publish Settings dialog box, shown in Figure 15-15. This tab has three areas where the audio quality of an entire Flash movie can be controlled globally.

Figure 15-15: The Flash tab of the Publish Settings dialog box has several options to control audio quality.

Tip 

You can also access the Flash tab of Publish Settings using the Property inspector. Click the document's Stage or Work Area, and in the Property inspector, click the Settings button to the right of the Publish label.

The Flash tab of the Publish Settings dialog box has three options for controlling audio quality:

The Set Options

Audio stream and Audio event have individual compression settings, which can be specified by their respective Set button options. If you click either Set button on the Flash tab, the same Sound Settings dialog box appears — it is identical for both Audio Stream and Audio Event, which means that the same options are offered for both types of sound. The Sound Settings dialog box, shown in various permutations in Figure 15-16, displays numerous settings related to the control of audio quality and audio file size. The type of compression you select governs the specific group of settings that appear.

Figure 15-16: The various options in the Sound

Note 

The impact of individual sound settings may be overridden by another setting. For example, a Bit Rate setting of 160 Kbps may not result in good sound if the Quality is set to Fast. Optimal results require attention to all of the settings. It's like a set of interlinked teeter-totters: A little experimentation will reveal the cumulative or acquired impact of each setting on the others. However, the need to experiment here is hobbled by the lack of a preview mechanism. By contrast, tuning a sound in the Library is much more serviceable because there's a sound preview button adjacent to the settings controls. For more about this workflow, refer to the following section of this chapter, "Fine-Tuning Sound Settings in the Library."

The specific options that are available in the Sound Settings dialog boxes are always related to the compression, or audio-encoding scheme, selected in the Compression drop-down menu. That's because different compression technologies support different functionalities:

Table 15-2: MP3 Bit Rate Quality

Bit rate

Sound quality

Good for

8 Kbps

Very bad

Best for simulated moonwalk transmissions. Don't use this unless you want horribly unrecognizable sound.

16 Kbps

Barely acceptable

Extended audio files where quality isn't important, or simple button sounds

20, 24, 32 Kbps

Acceptable

Speech or voice

48, 56 Kbps

Acceptable

Large music files; complex button sounds

64 Kbps

Good

Large music files where good audio quality is required

112–128 Kbps

Excellent

Near-CD quality

160 Kbps

Best

Near-CD quality

Table 15-3: Speech Sampling Quality

Sample rate

Sound quality

Good for

5 kHz

Acceptable

Sound playback over extremely limited data connections, such as 19.2 Kbps wireless Internet modems used by mobile devices

11 kHz

Good

Standard telephone-quality voice audio

22 kHz

Excellent

Not recommended for general Internet use. While this setting produces higher fidelity to the original sound, it consumes too much bandwidth. For comparable sound, we recommend using a midrange MP3 bit rate.

44 kHz

Best

See description for 22 kHz

Tip 

As a general rule, if you use the Publish Settings to control audio export globally, we recommend choosing MP3 at 20 or 24 Kbps. This will result in moderate to good sound quality (suitable for most Flash projects), and the ratio of file size to quality will give reasonable performance. 20 to 24 Kbps is an acceptable data rate for speech and short sound effects, while 96 to 128 Kbps is a better data rate for longer sounds and music.

Supporting Audio and MP3 Playback

System.capabilities.hasMP3

Tip 

In FlashLite 1.1 or higher, you can use the _capMP3 global property at run time to determine if MP3 playback is supported on a particular device.

More importantly, though, you can script your movies to check whether the Flash Player hasaccess to general audio output. Some devices with the Flash Player may not have any audio output. This property is

System.capabilities.hasAudio

Caution 

These new additions to the ActionScript language are only available in Flash Player 6 or higher. Earlier versions of the Flash Player will not recognize these objects or properties.

Категории