Identifying Sound File Import and Export Formats


Flash 8 can work with a wide variety of sound file formats. In this section, you learn which sound file types you can bring into a Flash document file (.fla) and how Flash can compress audio in a variety of formats in the final Flash movie file (.swf).

Import Formats

You can import most sound file formats in either the Windows or Macintosh version of Flash. All major sound file types, such as MP3 and WAV, are compatible on both versions. Once you import a sound file into a Flash document, you can edit the resulting .fla file on either platform.

Flash 8 can import the following sound file formats:

  • MP3 (MPEG-1 Audio Layer 3): Among the many advantages of MP3 sound files for Flash users, the most obvious is that they are cross-platform. Flash 8 can import MP3 files with either Windows or Mac versions of the tool. This single advantage improves Flash workflow in cross-platform environments. Other advantages are the efficiency of MP3 compression, the increasing availability of MP3 files, as well as the ease of creating MP3 files with common players such as Windows Media Player or Apple iTunes. For more information about MP3s, see the "MP3s Demystified" sidebar at the end of the section.

  • WAV (Windows Wave): Until the relatively recent support for MP3, WAV files reigned for nearly a decade as the standard for digital audio on Windows PCs. Still, the WAV format remains the primary acquisition sound format, the format in which you record sound from a microphone or other sound source on your computer. Flash can import WAV files created in sound applications and editors such as SoundForge or ACID. The imported WAV files can be either stereo or mono and can support varying bit depths and frequency rates. You can import WAV files directly into Flash 8 on a Mac.

  • AIFF or AIF (Audio Interchange File format): Much like WAV on the PC, the AIF format is the most commonly used digital audio format for sound acquisition on the Mac. Flash can import AIFF sounds created in sound applications and editors such as Peak, Deck II, or SoundEdit. Like WAV, AIFF supports stereo and mono, in addition to variable bit depths and frequency rates. Unassisted, the Windows version of Flash 8 cannot import this file format. But when QuickTime 4 or later is installed, you can import AIFF files into Flash 8 on Windows. The Windows version of Flash 8 recognizes, properly opens, and can edit Flash documents created on the Mac that contain AIFF sounds.

  • Sun AU: This sound format file (.au) was developed by Sun Microsystems and Next, and it is the native sound format on many Solaris and UNIX systems, just as WAV and AIF are native to Windows and Macintosh, respectively. The Sun AU format is frequently used with sound-enabled Java applets on Web pages.

  • QuickTime: You can import QuickTime audio files (.qta or .mov) directly into Flash 8, provided that you have QuickTime 4 or later installed. Once you import a QuickTime audio file into a Flash document, the sound file appears in the Library just as any other sound would.

  • Sound Designer II: This proprietary audio file format created by Digidesign is used with its signature professional audio suite, Pro Tools. You can import sounds that you save in this file format into the Macintosh version of Flash 8. If you need to use a Sound Designer II file (.sd2 file extension) with the Windows version of Flash 8, you can import the file directly if you have QuickTime 4 or later installed.

Note 

With Flash 8, you can link proxy sound files to Musical Instrument Digital Interface (MIDI) and Melody For i-mode (MFI) files that can be played back on mobile devices with Flash Lite. You'll learn more about this feature later in this section.

Tip 

Don't rely upon the imported sound that's embedded in the Flash document file (.fla) as your master or backup sound file. Always retain your original master sound file as a backup or for reuse in other multimedia projects.

These sound file types are structural or "architecture" based, meaning that they simply indicate the wrapper used to encode digital audio. Each of them can use a variety of compression techniques or a variety of audio codecs. A codec is a compression and decompression module for digital media. Sound and video is encoded (compressed) with a specific technique by an application or device. After it is encoded, it can be played back (decompressed) by a media player that has access to the codec module. In order for a sound file to play on your computer, you must have the audio codec used in that file installed on your system. MP3 files, for example, can be compressed in a variety of bit rates and frequencies, as can WAV and AIF files. Once Flash imports a sound file, the wrapper type (AIF, WAV, AU, and so on) is stripped. Flash simply stores the sound file as generic PCM (Pulse Code Modulation) digital audio. Moreover, Flash converts any imported 8-bit sound file into a 16-bit sound file. For this reason, it's best not to use any precompression or low bit depths on your sound files before you bring them into Flash 8.

Note 

You can adjust individual MP3 sound files in the Flash document's Library to retain their original compression. This is the sole exception to the rule we just mentioned in the preceding paragraph. As you'll see later in this chapter, however, Flash 8 may need to recompress all sound files in a Flash movie, depending on their use in the movie's timeline.

image from book
MP3s Demystified

MP3 is an amazing compression technology as well as a file format. It excels at the compression of a sound sequence — MP3-compressed files can be reduced to nearly a twelfth of their original size without destroying sound quality. MP3 was developed under the sponsorship of the Motion Picture Experts Group (MPEG) using the following logic: CD-quality sound is typically sampled at a bit depth of 16 (16-bit) at sample rate 44.1 kHz, which generates approximately 1.4 million bits of data for each second of sound — but that second of sound includes a lot of data for sounds that most humans cannot hear! By devising a compression algorithm that reduces the data linked to imperceptible sounds, MP3 developers made it possible to deliver high-quality audio over the Internet without excessive latency (the delay between loading a sound and playing it). Another way of describing this is to say that MP3 uses perceptual encoding techniques that reduce the amount of overlapping and redundant information that describes sound. As you'll learn later in this chapter, the Flash Player can actually buffer Stream sounds (which you can create from any sound file imported into Flash); this means that the sound begins to play in the Flash movie before the sound file has been downloaded in its entirety. Shockwave Audio, the default audio compression scheme for Macromedia Director — based Shockwave movies, is actually MP3 in disguise.

image from book

Export Formats

You can decide which sound encoding to use for audio when publishing Flash document files to Flash movie files (.swf). Although the default Publish Settings in Flash 8 is to export all audio with the MP3 format, you can export sound in several other audio formats. We note the benefits and drawbacks of each format in the list that follows.

Note 

Flash Professional 8 enables you to export device sounds in a Flash movie, for playback on mobile devices that use file formats such as MIDI and MFI. We provide an overview of this feature in this section.

Regardless of the format that you choose in your document's Publish Settings for exporting your sounds, you can individually specify a compression scheme for each sound in the Flash document's library. Furthermore, each format has specific options and settings that we'll examine later in this chapter.

  • ADPCM (Adaptive Differential Pulse-Code Modulation): ADPCM is an audio compression scheme that converts sound into binary information. It is primarily used for voice technologies, such as fiber-optic telephone lines, because the audio signal is compressed, enabling it to carry textual information as well. ADPCM works well because it records only the difference between samples and adjusts the encoding accordingly, keeping file size low. ADPCM was the default setting for older versions of Flash, such as Flash 2 and 3. It isn't as efficient as MP3 encoding but is the best choice for situations in which compatibility is required with all older Flash Players.

  • MP3 (MPEG-1 Audio Layer 3): Over the last three years, MP3 has become the standard for digital audio distributed on the Internet. Although MP3 compression delivers excellent audio quality with small files, it's much more processor-intensive than other compressors. This means that slower computers — and we mean slow, as in Pentium I or pre-PowerMac G3 processors — may gasp when they encounter a high bit-rate MP3 audio while simultaneously processing complex animations. As always, it's wise to know your audience. When in doubt, test your Flash movie with MP3 audio on slower computers. Flash Players 4 and higher support MP3 playback.

    Note 

    Flash Player 4 for the Pocket PC does not support MP3 sound. With Flash Player 6 and higher, you can use ActionScript's System.capabilities.hasMP3 property to determine if the hosting player device supports MP3 audio. You can learn more about this use of ActionScript in the Flash MX 2004 ActionScript Bible (Wiley, 2004) or later editions.

  • Raw (Raw PCM): Flash can export sound to .swf files in a raw audio format. If you use this setting, Flash won't compress any audio. However, uncompressed sound makes very large files that would be useless for Internet-based distribution. As uncompressed sound, audio in the imported sound file retains its original fidelity. We recommend that you use the Raw format only for Flash movies that you intend to distribute on fixed media, like CD-ROM or DVD-ROM, or for Flash movies that you intend to export as linear animation for video-editing purposes.

  • Speech (Nellymoser): This audio codec in Flash MX (Flash Player 6) is specifically designed for audio sources that contain mostly human speech, such as narration or instructional content. Macromedia licensed audio technology from Nellymoser, Inc., which specializes in the development of voice-only audio codecs. All sounds that use the Speech codec are converted to mono sounds. You can see the real power of this codec in live streaming audio delivered by Flash Communication Server MX, as this codec is incredibly efficient and a fast encoder with a low server and client processor overhead. For example, if you want to use a NetStream object in ActionScript to stream live audio from a microphone, the Speech codec will optimize the audio information very efficiently. You must use Flash Player 6 or higher to play sounds encoded with this format.

  • Device sound: If you use Flash Professional 8, you can link device sound files to imported sounds in your Flash movie. You use device sounds specifically for playback of Flash movies on mobile devices enabled with Flash Lite, a version of the Flash Player. Because the desktop Flash Player cannot play device sound file formats, you import regular sound files such as MP3s into your Flash document. These sounds are then used in a proxy fashion — you add the sound to event handlers (keyframes, buttons, and so on) just as you would any other sounds. Before you publish the Flash movie file (.swf), however, you change the settings of the sound file in the Library panel to point to a device sound. When the Flash movie is published, the device sound is embedded and used within the Flash movie, not the original imported sound.

Cross-Reference 

We'll examine the specific export options for each audio format later in this chapter. This section will help you determine which format you should use for your specific needs.

Table 15-1 shows the compatibility of Flash's audio export formats with various platforms.

Table 15-1: Audio Export Formats for Flash Players

Export format

Flash 3 or earlier

Flash 4 and 5

Flash 6 or higher

Comments

ADPCM

Yes

Yes

Yes

Good encoding scheme; compatible with all Flash players; works well for short sound effects such as button clicks

MP3

No

Yes

Yes

Best general use encoding scheme; ideal for music tracks

*Not compatible with Flash Player 4 for the Pocket PC.

Raw

Yes

Yes

Yes

No compression; lossless; large file sizes

Speech

No

No

Yes

Excellent compression for human speech; avoids "tinny" sounds for voices; ideally suited for real-time compression with Flash server-side applications

Device sound

No

No

No

Sound export feature available in Flash Pro 8; for use with MIDI and MFI files for playback on mobile devices with Flash Lite




Macromedia Flash 8 Bible
Macromedia Flash8 Bible
ISBN: 0471746762
EAN: 2147483647
Year: 2006
Pages: 395

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