Flash MX Audio Player
Multimedia is great. Things move, whiz, bang, beep, explode well you get the idea. Sounds are one of the coolest things that we can add to a site that elevates what we do above the world of text and animated GIFs.
We will be developing these Flash MX files: media-controller.fla (42kb), sound.fla (1787kb), test.fla (1805kb), and test-audio.fla (10kb). Apologies for the larger files, but they have a largish audio sample imbedded in them. When they are published as SWF files, they come in at 3kb, 24kb, 22kb, and 3kb, respectively.
But how do we implement all of those larger sounds? (The ones that you can't just tag on to a button press.) And how do you make them stream nicely? All too often an otherwise great online multimedia presentation grinds to a halt when audio files are played. It's also annoying that you can't usually scrub back or forward to an interesting bit (or skip over the boring parts).
This time we are going to develop an audio player in Flash MX, allowing your visitors to listen to all the samples you want to publish. Specifically, we will:
- Import audio resources and test the compression settings for the audio track.
- Generate some waveform images so that we can show people what the sounds look like.
- Provide a visual indication of the progress of the playback.
- Develop a set of controls for controlling playback.
Here's a big warning: there's a large chunk of tutorial to do bits 2 and 3 first before we get on to developing the controls. And this is a long tutorial. So, if you want to find out if this is worth reading, finish this introduction, check out the "how to use this" bit at the end, and see if you want to read the rest. (That's how I did all my study at University! Ha, hah!)
This tutorial comes in three parts:
- Load a sound into Flash and create some animation that plays with the sound. (The animation bit is optional.)
- Develop a set of controls to control playback of the sound and prepare the controls for use in any Flash file.
- Instructions on how to use the controls we have developed.
What we will not discuss is how to record and mix audio. You will need to supply your own samples to play with.
Before we go any further, I would like to point out that some of the screen shots are from the Western Australian Museum's "Western Australia: Land and People" exhibition. Included in that project were over eighty audio files: mostly commentary by the curators of the exhibition. Now we can all get that "behind the scenes" and "making of" info that is usually reserved for Discovery Channel or the extra audio tracks on DVDs! The Western Australian Museum's great content and our stylish Flash MX work produced an inspiring virtual exhibition.
I am assuming that you have had a glance through the Using Flash help file, and that you have completed the online Flash tutorials "Introduction to Flash MX Tutorial" and "Introduction to ActionScript Tutorial" that come with your copy of Flash MX. You should also be familiar with creating audio files. You may find our other tutorials useful. "Yet Another Flash MX Loader" discusses the creation of the GMG loader. And "Object VR In Flash MX" covers playing back 3D Object VR movies without using the QuickTime player.
|» Level Advanced|
Rating: 8 Votes: 63
|Tim is a co-director of the Glasson Murray Group, providing quality graphic design, illustration, 3D visualisation, interactive environments, virtual reality, multimedia and website services.|
|Download the files used in this tutorial.|
|Download (2157 kb)|
|More help? Search our boards for quick answers!|