Flash lets you add sounds into your presentation. The sounds are added in Frames in the Timeline.
There are two types of sounds: event sounds and stream sounds.
- An event sound needs to download completely before it starts to play. Event sounds continue to play until they are done or you explicitly stop them.
- A stream sound starts to play as soon as enough data downloads for the first few frames. Stream sounds are synchronized to the Timeline.
Flash supports the following sound formats: ASND (from Adobe Soundbooth), WAV, AIFF, AU, MOV, and MP3.
First, you need to import the sound into the Library. Then, you add it in Frames in your Timeline.
To import a sound file, click File -> Import -> Import to Library, then choose an audio file from your computer and click Open. Flash places a copy of the imported sound file into the Library.
- You can also use the sample Sounds library that comes with Flash, which can be opened from Window -> Common Libraries -> Sounds.
The sounds added in the Library will be included into the Flash presentation (the SWF file), so the size of the SWF file will increase depending on the size of the imported audio file.
Once the sounds are in the Library, you can add them in the Timeline using the Properties panel of the Frames (see the image below).
In Timeline, click on a frame where you wand to begin the sound, then in the "Properties panel", at the Name option (from the Sound sub-menu) choose the sound you want to use.
The Sound sub-menu contains a few options to define individual properties for every sound in your Flash document:
- Name - contains a list with the sounds included in the Library.
- Event - give the sound its very own timeline. The sound plays when the Playhead reaches the keyframe containing the sound, and continues to play until the sound finishes, regardless of whether or not the animation has ended.
If the Playhead reaches another keyframe that contains the same sound, it will begin playing on top of the original sound.
- Start - similar to Event, but doesn't allow the sound to play on top of itself.
- Stop - stops playing the sound specified at the Name option, without affecting any other sounds.
- Stream - causes the sound to remain synchronized with the Timeline. If the video can not keep up with the audio, Flash will automatically drop video frames to keep the audio synchronized.
- Repeat - specifies how many times the sound will be repeated. Loop sets to repeat the sound forever.
- Left channed - to play the sound through the left speaker.
- Right channed - to play the sound through the right speaker.
- Fade Left to Right - to begin playing the sound through the left speaker, and then switch midway through the clip to the right speaker.
- Fade Right to Left - to begin playing the sound through the right speaker, and then switch midway through the clip to the left speaker.
- Fate in - to start playing the sound softly, and then build to full volume.
- Fate out - to start playing the sound at full volume, and then taper off toward the end.
- Custom - opens the Edit Envelope window, which lets you to define effect for the sound.
Here is an example of how to use a sound from the Sounds library that comes with Flash:
- Open a new Flash document. Click the Window -> Common Libraries -> Sounds to open the "Library - Sounds" window (displayed in the image below).
Open the main Library panel (Ctrl+L), then chose a sound in the "Library - Sounds" and drag it in the main Library panel.
- Or you can import audio files from you computer, with File -> Import -> Import to Library.
- You can test the sounds in the "Library - Sounds" by clicking on them, then click the "Play" button.
- Now we add the sound in Timeline. Click the first keyframe, then in the Properties panel, in the Sound sub-menu, click the Name option list, and then choose the included sound.
- Press "Ctrl+Enter" to test the presentation.
- Change the Sync, Effect and Repeat properties and press "Ctrl+Enter" to understand their effects.
To stop a sound:
- In timeline, click on the frame in which you want to stop the sound.
- If it is a Static frame, you must convert it in a keyframe (or Blank Keyframe), from Modify -> Timeline -> Convert to Keyframes (or "Convert to Blank Keyframes").
- In the Properties panel, in the Sound sub-menu, click the Sync option list, and choose Stop.
The Properties panel provides some effects you can apply to the volume of a selected sound. The drop-down list next to Effect includes effects such as "Fade In", "Fade Out", "Fade Left to Right", and "Fade Right to Left". To customize these settings further, you can either select
Custom from the list or click the Edit button (next to drop-down list) to access the ""Edit Envelope" dialog box, which is shown in the image below.
Adding sound to Motion Tween
The frames in a Motion Tween don't have in their Properties panel an option to add sounds.
If you want to include a sound in a Motion Tween animation, you must create a new Layer and add the sound in the frames of that Layer.
These are the steps to add sound to a motion tween animation:
- The sound will begin to play starting from that Blank Keyframe, along with animation. The Timeline will appear similar to the picture below.
- Click Insert -> Timeline -> Layer to create a new Layer
- In this new layer, click on the frame from which you want to begin the sound, then click Insert -> Timeline -> Blank Keyframe (or right-click and choose Insert Blank Keyframe).
- Now, you can use the Properties panel of this keyframe to add the sound in it.
- The "Layer 1" contains the Motion tween frames, the "Layer 2" contains the sound, starting from Frame 11.
Flash has a few compression settings that would reduce the size of the SWF exported file (which contain sounds).
In the Library panel, double-click on the name of the sound (or right-click on it and choose "Properties"), Flash will open the "Sound Properties" window, with settings for the selected audio file, like in the image below.
Changing the compression will also change the sound quality, Flash can't get a better quality than the original audio file, but can decrease its quality when the values from "Bit Rate" and "Quality" are reduced.
- MP3 is the best type compression for a good quality / size ratio.
- The "Update" button is used to reload the sound file from its initial location.
- If a sound has 4 seconds and the FPS is 24, the sound needs 4x24 frames (96) in timeline.