There are currently several types of sound that can be used on the web and be specifically imported into Flash. All sound in Flash is digitized sound that has a waveform describing the sound's frequency, amplitude and harmonic content. The waveform captures sound by sampling the sound thousands of times per second. The samples are stored on your computer. On a PC, the file extension .wav stands for waveform. Mac's native sound file format is .aiff.
Audio CD
Audio CDs hold up to 75 minutes of hi-fi recorded sound with a sample rate of 44,000 samples per second. That's just about the top level of audible sound for humans. The samples on Audio CD are 16 bits which enable a range from a soft whisper to a loud scream.
MP3
MP3 is MPEG Audio Layer 3 file using MPEG audio compression-decompression (codec). This compression results in a smaller size audio track that maintains its quality. MP3 files are much smaller than other sound files and are perfect for transmission over the Internet.
You can create your own sounds for your Flash movies. Use sound included in the Common Libraries>Sounds (which are mainly event sounds like clicks and buzzes) or search for sounds on the Internet. There are a number of new sound sites specifically creating sound loops for Flash files. Since Flash is basically an Internet tool, sound files have to be used judiciously as sound files can bloat your file size. Hear this: 60 seconds of CD quality sound at 44,100 kHz, 16-bit, stereo weighs in at a big 10.5MB. This is HUGE! This is why so many Flash sites use looping sounds that are lower kHz, 8-bit, mono.
Flash has limited sound-editing features. It's best to use an external sound-editor to create and/or edit sound files. Editing sound files will enable you to change the tempo, delete tracks, re-mix the sound and can be a lot of fun. SoundEdit 16, Sound Forge, Cool Edit 2001, Sonic Foundry, Cakewalk, Goldwave, beatnik, Cubase, mEdit, and PEAK are a few sound-editing programs. Search the web for others which offer fully functioning trial versions for 30 days.
In order to create your own sound files, you need a sound card, a microphone, and speakers. Both Windows and Mac operating systems (OS) come with limited sound recording features. In Windows, you can double click the sound icon on your taskbar or look in the Windows start menu for a group related to sound and open your sound mixer software. Select Properties from the Options menu, click the recording button, click OK and you should be in your Recording Control Window. If you're recording from a microphone, select the microphone source. Play around with recording sound into the mike or capturing and recording sound from files on a CD. Please note copyright laws. To be safe go to one of the websites listed below to collect some royalty-free sound loops.
Note: If the sound is not yours, don't use it without acquiring copyright permission.
Sound files can bulk up your file size quickly. This can mean trouble for your web audience. Most likely they aren't going to hang around to wait for your groovy sound files to load. Here's some more info about sound that could help you make some sound decisions about using sound with prudence.
Most sound files have three parameters that you can modify. These are the sampling rates in kilohertz (KHz), bits per sample in bit-depth, and channel usage. The higher you set the samples per second and the higher the bits per sample, the better the quality AND the larger the file size.
Sampling rate determines the frequency response of sound. The following list illustrates the quality of sound for each of the sampling rates in samples per second. You may find charts in books with differing numbers within a similar range.
telephone - 6,000 kHz
AM radio - 11,000 - 15,000 kHz
FM radio - 37,500 kHz
vinyl records - 40,000 kHz
CDs - 44,100 - kHz - the cleanest sample
You may not realize the difference in the quality of sound from a telephone call to a CD but you will notice the difference when you resample the sound on your computer and play it back.
The second modification we can make to our sound file is Bits per Sample or sound resolution or bit depth.
Bits per sample reflects the dynamic range or how much volume difference there is between the loudest and softest sounds in a recording similar to the tonal range of a photograph. Computer audio normally comes in 8-bit or 16 bits per sample. An 8-bit sample uses 256 units of data to describe the sound level. A 16 bit uses 65,000 units. That's a huge difference in file size.
You don't need to know all the details of sound-editing to use sound appropriately in Flash, but do know this: File size is determined by multiplying the bits per sample by the sampling rate. If you can use 8-bit and get adequate quality, stick with 8-bit. However, I recommend capturing your sound at the best quality you can and editing the file to get the smallest file size with acceptable quality after it's captured. Typically the lowest quality sound file is 11kHz, 8-bit mono. The highest quality you can work with on a computer is 44kHz, 16-bit stereo.
If you record at an inferior quality, you will have to record again, as you cannot up-sample a sound file. Many people settle on about 22,000 kHz for the web. Experiment with your sound-editing program to get the best quality with the lowest file size.
Your channels for sound are stereo and monaural. Record with stereo. View your file size. Change to mono. Is your sound good enough to use? Stereo doubles the file size of mono.
Note that the process by which you modify your sound will affect the final file. For those of you interested in editing your own sound files, get a high fidelity CD quality stereo sound file. Save 3 copies and try these 3 processes:
Resample to 11 kHz, reduce to 8-bits, convert to mono.
Reduce to 8-bits, convert to mono, resample to 11 kHz.
Convert to mono, resample to 11 kHz, reduce to 8-bit.
Evaluate the results.
On the web you can have extended sound such as background song, a sound media component such as voice over, and sound effects that are usually played in response to user actions such as button clicks and interface sound effects. Luckily, Flash streams sounds over the web, meaning that the entire file does not need to download in order to begin playing. Flash is a streaming media.
A good source for Flash inspiration can be TV commercials. They are short (OK - too long for me), peppy, state their purpose in a few seconds, have background audio in the form of voice overs, short snappy sounds, music, and animation. The point is that you have a few seconds to capture and hold your audience to present your message. Your Flash message might be entertainment, education or information.
Flash enables you to synchronize sounds such as button clicks and interface sounds to specific events. This type of sound is called an event sound. These sounds are not added to the main timeline. They play independently of the main timeline. They can be assigned to button states.
Sound file formats that Flash imports:
Digital sound is often referred to as sampled sound. Here are the file formats supported:
windows: .wav, .mp3 macOS: .aiff, .mp3
If you have Quick Time 4 or greater installed on your machine, you can import these additional file formats:
windows: .aiff, sound only Quick Time audio files, .au macOS: sound designer II, sound only Quick Time audio files, Au, system 7 sounds, .wav
If you have a sound file in both .wav and .mp3 format, it's best to use the .wav file. MP3 is already compressed, so you'll be starting out with less quality using the .mp3.
You import sounds into Flash by going to the File Menu - File>Import and navigate to the sound file on your computer.
The sound will not appear on the stage the way graphic files do when importing. The sound file goes into your library and is identified by a sound symbol icon that looks like a mini speaker. When you select the sound, the waveform will be displayed in the top pane of the library window. If the sound you imported is in stereo, you'll see two parallel horizontal waveforms in the library's preview pane.
INTERACTIVE Flash DEMO - click on the upper right arrow button
The waveform for this mono sound is displayed in the top pane of the library window. (This is Flash 5 interface image - note that the icons for movie clips have changed in MX version).
Play the sound by clicking on the arrow in the upper right corner of the library top window.
This small Flash movie is a whopping 27k.This is huge for this much data. Now you see how audio can increase the file size of your Flash movie.
There are some things I might be able to do in Flash to export this sound with better compression to lower the file size. Alternatively, I can take the file into a sound-editing program, edit it to reduce the file size and then re-import the modified sound file back to Flash. I can also update the file from the Sound Properties selection on the Library Options Menu.
Flash Sound Editing Features
To edit sound properties in Flash, you need to open the Sound Properties Window.
Open a movie that has sound or create a new movie and import a sound file.
Open the library of your current movie and select a sound symbol from the library by clicking on the name of the sound. Right click on the name of the sound and select Properties... from the context-sensitive menu. You can also double click directly on the sound file's name in the library to open the Sound Properties Window. You can set the sound compression, bit rate, and quality in the Sound Properties Window.
In the Sound Properties we see a display of the wave form on the upper left. The sound name is displayed with the path from our local hard drive below. The date the sound was captured is followed by the sample rate and bit depth of the sound and the file size. This short gong wave file is over 46K - way too big to use in this movie. The listing in this upper portion of the window refers to import information.
The bottom part of this window displays export settings for this sound file: drop-down menus to set compression, bit rate, and quality. Mine shows MP3, 16, fast. The checkbox to convert stereo to mono is dimmed because I imported this file in mono. The bottom line tells me that the file is 18.1% of the imported original with these settings.
Let's review the export settings for sound in the Sound Properties Window. There is also an option to set settings for sound in the Publish Setting Window which we will adjust in the next lesson.
Compression:
Flash offers 4 options for compression. You can set the properties of each sound individually in the library or use a default setting in the Publish Settings window which affects all sounds. I recommend setting each sound individually.
They are Default, ADPCM, Raw, and MP3. You can read more about each setting, but for now, you can use this general rule: Use ADPCM for short incidental sounds and MP3 for your streaming and background sounds. Use loops to keep your sound files short. Sound loop is just a small chunk of a sound file that has been edited to repeat over and over without interruption in the sound.
Default - uses the default settings for sound export in your Publish Settings Window which we will discuss in the next lesson.
ADPCM - OK to use for short event sounds like button clicks and other incidental audio. Compress these sounds as small as you can.
Raw - export the sound uncompressed (why would you do this?) Publishing the movie for the web using Raw would make your file size too large. You might use raw for a screensaver that runs from a hard drive.
MP3 - use for most of your streaming sounds, background tracks, etc. It's best for the Internet. You can convert a wave file into .mp3 and export the file as an MP3 in Flash.
Selecting these compression settings displays different drop-down menu options for each of the settings. Use the Test button on the right of the Sound Properties Window to hear the sound with the adjusted export settings. The Update button on the Sound Properties Window enables you to update the sound file if you've edited it in an external sound-editing program without having to re-import the sound file. When you like the sound and have an acceptable file size, click OK. I advise optimizing each of your sounds individually rather than using the default sound settings.
Please continue to the next section of this lesson.