ptg 12 12 What You’ll Do 307 Working with Sounds Introduction Incorporating audio can really bring life to a Flash movie; however, the effect is very subtle. For example, most people would not be able to tell you the background music playing behind their favorite movie, but try leaving the sound out and they'll immediately notice. This makes audio a powerful influ- ence on the viewers of your Flash movies. Adobe under- stands the power of audio and gives you the ability to import audio in a variety of formats, including ASND, MP3, WAV, AIF, and AU. If you want more control over your audio, you can edit sounds in Adobe Soundbooth directly from Flash. You can use on-clip controls to make fast edits and intuitive, task- based tools to clean up recordings, polish voice-overs, cus- tomize music, modify sound effects, apply high-quality filters, and much more. There are two types of sounds: event sounds and stream sounds. An event sound needs to download completely before it starts to play, while a stream sound starts to play as soon as enough data downloads for the first few frames. Event sounds continue to play until they are done or you explicitly stop them. Steam sounds are synchronized to the Timeline for playing on a Web site. Flash audio can be controlled using Flash's version of JavaScript, called ActionScript, and it even gives you the abil- ity to load streaming MP3 files. Add to that the ability to choose between mono and stereo, and you can further reduce the size of your audio files (mono audio files are half the size of stereo). The one drawback to using audio is that it produces a much larger file (even compressed audio files are relatively large), but even this can be reduced to a minimum by using shared audio libraries. Since audio files create large Flash movies, use sounds when they are necessary to the design of the Flash movie, and remember that sometimes silence is golden. What You’ll Do Import Audio Use Audio on the Timeline Load a Sound from a Shared Library Use Audio with ActionScript Load a Streaming MP3 File Sync Sounds to the Timeline Add Effects and Looping Sounds Publish Documents Containing Audio Edit Sounds Edit Sounds Using Soundbooth From the Library of Wow! eBook ptg 308 Chapter 12 When working with Flash, understand that Flash will let you import audio in a variety of formats. However, Flash has no way to record or create sounds; you can do it with Adobe Soundbooth. Therefore, audio must come from external sources. You can use the sample Sounds library that comes with Flash or conduct audio searches on the Internet using your favorite search engine to find a lot of audio files. One other consideration is creating your own audio, using your computer, an attached microphone, and a bit of imagination. Flash supports the fol- lowing sound formats: ASND (from Adobe Soundbooth), WAV, AIFF, MP3, Sound Designer II (Mac), Sound Only QuickTime Movies, AU, and System 7 Sounds (Mac). When you import an audio file to Flash's Stage, you will first need to have a specific layer and keyframe selected. When you work on a Flash project, it might be beneficial to bring audio files directly into Flash's Library. That way you have easy access to them when needed. Any unused audio files are purged when you publish the Flash movie. Importing Audio Import Audio Files to the Stage Select a keyframe in the Timeline in which you want the audio file placed. IMPORTANT You should always place audio files in a separate layer. This gives you easy access and control over the audio file once it's been placed on the Stage. Click the File menu, point to Import, and then click Import To Stage. Navigate to the drive or folder location with the files you want. Select one or more audio files to import. To selec t more than one file, c lick an audio file, then hold down the Shift key and click another file to select contiguous audio files, or hold down the A (Mac) or the Ctrl key (Win), and then click to select non-contiguous audio files. Click Import (Mac) or Open (Win). 5 4 3 2 1 5 Using QuickTime for Sound In addition, many formats that are not easy to import can be con- verted using the QuickTime plug-in. Point your browser to www.quicktime.com and download this free plug-in. You can also purchase QuickTime Pro to perform a wider range of conversions. In addition, you can perform limited conversions for free at www.itunes.com . For Your Information 3 4 From the Library of Wow! eBook ptg Chapter 12 Working with Sounds 309 Import Audio Files to the Library Open and select the library where you want to import your audio files. Click the File menu, point to Import, and then click Import To Library. Navigate to the drive or folder location with the files you want. Select the audio file or files you want moved into the Library. Click Import To Library (Mac) or Open (Win). 5 4 3 2 1 Sound wave Current audio in library Did You Know? You can sync sound to a Timeline ani- mation. Select the sound on the Stage, and then change the Sync option on the Properties panel to Stream. Flash will force the animation to sync to the timing of the audio file even if it has to drop video frames to keep up. See Also See “Using Audio on the Timeline” on page 310-312 for information on import- ing audio using an external library. Audio files Audio files are embedded directly into the Flash movie. When you publish the Flash movie, by default, all audio files are embedded with the movie. Therefore, the Flash SWF file becomes a self-contained movie file without the need to access the original audio files. For Your Information 1 Sample Sounds library From the Library of Wow! eBook ptg 310 Chapter 12 Once you've imported audio files into the active document's Library, it's a simple matter to transfer the file to the Timeline. Flash's Timeline is actually a frame-by-frame representation of the Stage. For example, if you select frame 23 on the Timeline, the Stage displays the contents of the 23rd frame on the Stage. Audio, however, does not have a visible Stage object, so when you add an audio file to the Timeline, the effects are only apparent on the Timeline, not the Stage. Flash's Library holds all of the audio files that you've imported into the active Flash docu- ment. No matter how many times you use that audio file in the source document, Flash only needs to save it one time in the published Flash movie. In addition to the main Library, you can also use audio from the Sounds library that comes built-in to Flash. One of Flash's powerful fea- tures is the ability to use audio files from other Flash libraries. External Flash libraries are simply Flash source documents, which have an active Library. This gives you the ability to create libraries of audio files and use them over and over again. Using Audio on the Timeline Add Audio Using the Library or Sound Library Open the library that you want to use: ◆ Library. Click the Window menu, and then click Library. TIMESAVER Press A+L (Mac) or Ctrl+L (Win) to open the Library panel. ◆ Sound Library. Click the Window menu, point to Common Libraries, and then click Sounds. Select a layer and keyframe in the Timeline in which you want the audio file placed. Drag the audio file from the Library directly onto the Stage. Flash places the audio file in the selected keyframe. 3 2 1 3 Audio file placed on the keyframe. Library Sound library From the Library of Wow! eBook ptg Chapter 12 Working with Sounds 311 Add Audio Using an External Library Click the File menu, point to Import, and then click Open External Library. Navigate to the drive or folder location with the files you want. Select a Flash document that contains an active Library. Click Open. Drag items from the external Library directly to the Stage. Drag items from the external Library to the active document's Library. IMPORTANT When you drag an object from an external Library onto the Stage of the active Flash document, it is automatically added to the active document's Library. 6 5 4 3 2 1 2 5 4 Did You Know? You can use a single Library panel for all open documents. When you open multiple documents, Flash now consoli- dates all the libraries into a single Library panel. Click the list arrow but- ton (located at the top of the Library panel) to select from any available library. See Also See “Working with the Library Panel” on page 136 for information on using the single library panel and other options. 3 From the Library of Wow! eBook ptg 312 Chapter 12 By default, Flash embeds audio files directly into the published (.swf) file. You have the option of loading audio files from a common Library. This gives you the advantage of using the same sounds in several Flash movies at the same time. For example, you create a Web site using fifteen separate Flash movie files, and each one uses the same back- ground music. Rather than embed the same sound fifteen times, you can simply load the sound, when needed, from a common Library. Shared libraries are simple Flash documents that are set up to share their files between several Flash movies. The process is easy, and the rewards are great, and you don't increase the file size of Flash movies using shared Library elements. Once you've created and defined a Flash document as a shared Library, you can use the items in other Flash movies without increasing the size of the Flash published .swf file. Loading a Sound from a Shared Library Create a Shared Audio Library Create a new Flash document. Add the audio files to the document's Library. They do not have to be placed on the Stage. Click the File menu, and then click Save. Use a distinctive name for the source document. Select an audio file in the Library. Click the Library Options button, and then click Properties. Select the Export For Runtime Sharing check box. ◆ If the check box is not available, clear the Import for runtime sharing check box. Enter a distinctive name for the Identifier field or use the default. Enter the name of the published document into the URL field. Click OK. Repeat steps 4 through 9 until all the audio files are correctly linked. Click the File menu, and then click Publish to create the Flash .swf file. Close the original source file. 11 10 9 8 7 6 5 4 3 2 1 4 5 6 8 7 9 From the Library of Wow! eBook ptg Chapter 12 Working with Sounds 313 Work with Shared Audio Libraries Click the File menu, point to Import, and then click Open External Library. Select the shared Library, and then click Open. The items in the external Library will be grayed out, indicated they are sharable items. Drag the audio files from the external Library to the Library of the active document. To displ ay or change link properties for an audio, double- click the audio icon in the Library, click Advanced (if necessary), view or change link options, and then click OK. When you publish the Flash .swf file, the audio files will be drawn from the common Library, without increasing the size of the Flash movie. 4 3 2 1 External Library (Shared) 3 Linkage settings for audio Active Library 4 Did You Know? A Flash Library can be shared with other designers. Since a Library is sim- ply a Flash movie with Library ele- ments, you can create common libraries of often-used elements, and then give them to other designers. When you're working with two or more designers, this is a great way to maintain consistency on a complex project. From the Library of Wow! eBook . document, Flash only needs to save it one time in the published Flash movie. In addition to the main Library, you can also use audio from the Sounds library that comes built-in to Flash. One of Flash& apos;s. Sounds library that comes with Flash or conduct audio searches on the Internet using your favorite search engine to find a lot of audio files. One other consideration is creating your own audio,. QuickTime Pro to perform a wider range of conversions. In addition, you can perform limited conversions for free at www.itunes.com . For Your Information 3 4 From the Library of Wow! eBook ptg Chapter