Importing Sound into a Document


There are many different kinds of files that you can import into Flash documents. If you are importing sound files, you can use MP3, AIFF (Mac), and WAV (Windows) files. If you have QuickTime installed on your Mac or Windows computer, you can also import additional file formats, such as Sound Designer II files and AIFF and WAV files on either platform. MP3 files can be dynamically loaded into Flash 8 Basic using ActionScript, or the MediaPlayback component in Flash 8 Professional.

You can import MP3s into a FLA file and place a sound in the Timeline or you can dynamically load an MP3 from the server when the SWF runs. You can set the MP3 to stream or load it into memory and play it when event occurs.

Many Flash designers and developers create or find loops to use in their SWF files. Loops are a good way to create the illusion of having a lot of loaded sound, but keep the content small and quick to download. You can find sound loops to download online that are free to use in your projects, or you can create your own loop using audio software such as ReCycle, Cakewalk Plasma, or Acid Pro. Don't forget GarageBand for those of you on OS X.

Note

You should make sure to create a loop that loops seamlessly. Loops must begin and end when the waveform crosses the "0 crossing" between the positive and negative waveform where there is no sound. If you trim your music exactly to the beat, so the waveform is crossing the 0 mark, you will not hear the distracting "pop" at the end of your loop. Also, make sure to remove any extra space at the beginning and end of the loop. It helps to create a loop that has an odd number of bars, which means that instead of 4 bars if you are using 4/4 time, create 5 bars of music. The uneven nature means that it will take the ear a longer time to recognize the sound is a loop.


1.

Create a new FLA document and call it sound.fla. Save the document in the TechBookstore folder on your hard drive.

You will use this file to import sound and experiment with it some. You will not use the file in your Tech Bookstore website, however.

2.

Copy sound.mp3 from the lesson07/assets folder on the book's CD-ROM onto your hard drive.

You can copy the file anywhere you want on your hard drive, but be sure to remember where it is located so you can find it in the following step. This MP3 file will eventually play in the background of the tour you will create in the following lesson. It is approximately eight seconds long and will be dynamically loaded in as an event sound in the background.

3.

Choose File > Import > Import to Library. Browse to find the MP3 file on your hard drive. Select the file and click Open (or Import to Library on the Mac). Then open the Sound Properties dialog box.

After you choose the MP3 file and click Open, the sound is imported directly into the library in Flash. Open the library and find the MP3 sound you just imported. Right-click (or Control-click on the Mac) the sound itself and select Properties from the contextual menu. The Sound Properties dialog box opens, in which you can modify the export settings for the sound.

4.

Deselect the Use Imported MP3 Quality check box above the Compression menu.

MP3 is Flash 8's default sound compression type, so it is selected in the Compression menu automatically. Because you imported an MP3 file, Flash assumes that you want to use the imported sound file's quality settings. Deselecting this check box gives you the ability to change the quality settings in Flash, so that you can have a higher- or lower-quality sound. The tradeoff to the higher quality sound, of course, is file size.

Take a few minutes to try different bit rates with the MP3 compression type. Press the Test button to hear what the new bit rate will sound like in the final SWF file. Notice that as you change the bit rate, the new resulting file size for the MP3 file is summarized at the very bottom of the dialog box.

When you are finished, click OK to exit the dialog box.

Note

You can set overall export settings in the Publish Settings dialog box (File > Publish Settings), but the properties for an export that you choose in the Sound Properties dialog box override those settings. However, if you choose "Override sound settings" in the Publish Settings dialog box, the settings in Sound Properties are overwritten. You will learn more about Publish Settings in Lesson 11.

5.

Save the file before moving on to the next exercise.




Macromedia Flash 8. Training from the Source
Macromedia Flash 8: Training from the Source
ISBN: 0321336291
EAN: 2147483647
Year: 2004
Pages: 230
Authors: James English

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