Sound in Flash
Written by Amanda Kern
Advantages and disadvantages to using sound
Sound is one of the most influential aspects to interactive projects. Regardless of how sound is used, it is certainly one factor that will leave a lasting impression with those that view your projects. Let's overview a few advantages and disadvantages of sound.
- Grabs a user's attention. A Flash animation without sound could be compared to watching a mime acting out a scene without talking. If animated effectively without sound it's certainly possible to still have effective animation, however, in many cases the impact is much greater if there is sound. Think about it, what would some of the great action movies be like without sound? Often times the sound can help tell a story.
- Evokes an emotional response. Use of sound can evoke emotions such as humor, anticipation, fear, or sadness.
- Adds to file size. An unfortunate disadvantage that might influence your use of sound is that it can cause your file explode in size. There are ways to reduce the optimization settings to control file size some.
- Can limit the impaired. If your movie relies heavily on sound to tell a story it's possible that it might limit users that might be impaired or incapable of using sound.
- Can annoy users. Unfortunately misuse of or overuse of sound can also annoy users. It's important that we understand how to correctly apply sound in Flash and also realize that you don't just add sound to a project to make it "cool". Sound should always have a purpose.
Sound file formats supported by Flash
Before we start using sound in Flash we've got to be familiar with the sound file formats that we can import into Flash. The three main file formats we can import into Flash are:
- WAV (Windows only)
- AIFF (Macintosh only)
- MP3 (Windows or Macintosh)
If you have QuickTime 4 or later installed on your system, you can import these additional sound file formats:
- AIFF (Windows or Macintosh)
- Sound Designer II (Macintosh only)
- Sound Only QuickTime Movies (Windows or Macintosh)
- Sun AU (Windows or Macintosh)
- System 7 Sounds (Macintosh only)
- WAV (Windows or Macintosh)
Luckily there are a lot of free or low cost sound resources available online, here are just a few that you might find beneficial
You'll find out quickly that Flash is not the place to edit your sound files. Flash is quite limiting when it comes to altering your sound files. If there ever comes a need to edit or even create your own sound files you should consider using a sound editing program. Most sound editing programs enable you to chop up files into smaller segments, fade in or out, or change sound levels to make the sound seem softer or louder. Here are a list of just a few that you might find useful:
But what about sounds I have in iTunes?
If you use iTunes regularly you might notice that sounds are often in a different format (.m4p), and yes, this file is not supported by Flash. You are able to convert sounds to different formats from iTunes to another format that Flash will accept [http://docs.info.apple.com/article.html?artnum=93123]. Another alternative is to burn a CD which will convert the sound to wav or aiff file format.
Importing sound to a Flash file is the same concept as importing other graphical assets. You may use either Import to Library or Import to Stage, however, the sound will only go to the library no matter which option you use. You may select more than one sound at a time to import to the library.
Once you've imported your sounds they appear in the library. The sounds can be played directly from the library before you decide to add them to the timeline.
Adding Sound to the Timeline
There are two main ways to add sound to the timeline:
- Drag the sound to the timeline. With all frames deselected you can drag your sound from the library to a keyframe to add it to your movie's timeline. You must add sound to a keyframe, if you do not it will apply it to the last keyframe in the timeline. You will notice the waveform in the timeline once the sound has been added.
- Add the sound using the property inspector. You may alternatively use the property inspector to add your sound. Select the keyframe you wish to apply the sound to. In the property inspector sound options will appear. You may choose sounds from the drop down menu to add to the selected keyframe.
Sound Options in Flash
We do have a few options available for sound in Flash. Let's take a moment to take a closer look, this knowledge might just make the difference in applying the sound to your project appropriately. To access these options you must have your sound applied and the keyframe that has the sound applied must be selected.
Sound Sync settings
Among all of the sound options, the syncronization choices are the most crucial to understand when using sound in Flash. Let's take a moment to clarify each sync setting available:
- Event. You should use the event sync setting primarily for "events" that might occur in your Flash movie. Event sounds are generally very short and coincide with "events" users might physically do in your movie. Event sound is great for adding sound to buttons. If you choose to use event sound for longer clips the sound will loop on top of itself if you do not accommodate adequate space on the timeline for the sound file.
- Start. This sync setting is much like event, except it will tell Flash that it shouldn't play the sound again if the animation loops.
- Stop. Obviously this is self explanatory, it stops your sound.
- Stream. The stream sync setting prepares sounds for the web. It generally should be used for longer clips because it enables the user to download small amounts of sound at a time so they can view the movie sooner. Streaming sound will only play for as long as you have frames in your movie.
Repeat vs. Loop
If you're new to Flash "repeat" and "loop" might seem pretty similar and so much so that you might not understand which you should use, so let's clarify and explain the differences:
- Repeat. Gives you the option to choose how many times you want the song to play, no matter how many frames you have in your timeline.
- Loop. This option will "loop" the sound until your timeline has ended, this is ideal for shorter sound settings that you might wish to loop until your timeline has ended.
Sound Effects available in Flash
The "effects" available in Flash are the only options you have to edit sound in Flash. From the drop effect down menu you have the following choices:
- Left Channel. Will cause your sound to play through only the left speaker.
- Right Channel. Will cause your sound to play through only the right speaker.
- Fade left to right. Will cause your sound to start playing in the left speaker and then half way through the sound file it will switch to the right speaker.
- Fade right to left. Will cause your sound to start playing in the right speaker and then half way through the sound file it will switch to the left speaker.
- Fade in. Will cause your sound to gradually start playing to it's normal volume.
- Fade out. Will cause your sound to transition smoothly to a lower volume as it ends.
- Custom. Will open up a custom audio window which will allow you to change the fade in and fade out points. (Note: the "edit" button in the property inspector sound section will also prompt this dialogue box to appear.)
Event vs. Streaming Sound
It's easy to confuse the two main sound sync settings so we're going to take a moment to clear up the differences:
- The "independent" sound setting. Event sounds are independent of the main timeline. What does this mean? Well, if our sound file is several minutes long but we have only 50 frames in our main timeline it will reach that last frame and continue playing the sound. Because the main timeline loops, the sound will also loop. The end result is your sound file playing on top of itself numerous times, better known as sound chaos. You will also have to listen to the entire sound if you try to play your sound from within Flash.
- Best for "short" sounds (a.k.a. events). Event sound are best for short sounds that are often used with "events", for example a user clicking or rolling over a button.
- Load entire sound. To use event sound your Flash file must load the entire sound file before it plays it back to the user.
- Syncronized sound setting. By choosing "stream" for your sync setting Flash understands that you intend to use your file on the web, therefore it does syncronize your sound with your timeline. Also, it loads small amounts of your file at a time so that it may feed your project over the web as it's downloading.
- Great for longer sounds. Streaming sound is best for longer sounds that you are trying to syncronize with an animation.
- Streaming is bad for buttons. Don't use streaming for buttons, it may not recognize the sound if it is set at "stream".