As Internet bandwidth increases, people expect richer and more stimulating experiences from web sites. More and more webmasters now turn to music as the “next step” in making their web sites and Flash presentations a more immersing experience.
Working with sound and music has been considered something of a “black art” for generations, and we musicians and sound gurus are often seen by others as a little bit weird. But I’m here to lift the lid on some of the things you need to know to add music to Flash movies.
Short loop or long music track?
When adding music to a Flash or web site, many designers prefer to use a “loop” of music. A music loop is a short piece of music (typically 5-20 seconds long) that starts and ends in such a way that when you reach the end of the music, you can jump to the beginning and start playing the whole thing again, so it sounds like the music just continues.
Using a loop has its advantages and disadvantages. The disadvantage is that the music becomes repetitive. Of course, everybody would have liked to have 10 minutes or more of music that keeps changing and evolving, and never gets repetitive. Long pieces of music require a lot of data to transfer between your web server and the visitor’s browser though, and it will slow down your site considerably – which is the last thing you want. Speed of delivery is everything on the Internet today, where people’s attention spans are shorter than ever before.
By using a short piece of music (a loop) that just loops and repeats, you only need to transfer a few seconds worth of music to your visitors’ browser. Most web designers today go with short loops because they feel that speed of delivery weighs heavier than variation in the music.
Avoid mp3 format for loops
Today’s most commonly used file formats for audio are WAV and mp3 format. A lot of sound resources offer their music loops in mp3 format, because mp3 files are compressed and represent high sound quality in very small sound files. However, if you are planning to use a “loop” in your Flash presentation, you should steer clear of music loops delivered to you in mp3 format.
Why? Because mp3 loops don’t loop smoothly. Due to the nature of the mp3 file format and compression routines, an mp3 file is compressed in chunks of 1152 bytes at a time. This leads to a very, very short bit of silence added to the beginning and end of all mp3 files. This inserted silence is so short that you don’t notice it when you just listen to music regularly. But when the music has to loop 100% seamlessly from the end back to the beginning to create a never ending loop of music, then this little added silence at the beginning and end becomes noticeable by causing a little “jump” or “hickup” at the precise moment when the music goes back to the beginning and starts again. You can hear this jump on some web sites where the webmaster has used an mp3 file as his music source file. The music follows a perfectly steady rhythm for a while, but seems to “stumble” momentarily every now and then. The human brain, consciously as well as subconsciously, finds it very disturbing as the regular pattern of rhythm is broken momentarily, and this does nothing to help the overall impression of the quality of the site.
For this reason, when you search for music loops to use in your Flash movies, make sure you get your loops in WAV format, not mp3. When you eventually save out your Flash .SWF file including the music and everything else, the music will be compressed in the same way anyway. So whether you use a compressed mp3 file or a non-compressed WAV file as your sound source doesn’t make any difference to the file size of loading time of your finished Flash movie.
In my next article, I will look at different methods of inserting music into Flash movies and how to get the best possible sound quality with the lowest possible loading time.
Bjorn Lynne is a musician, sound engineer and webmaster at http://www.shockwave-sound.com/ which offers high quality royalty-free music loops to web and Flash designers.