![]() |
||
So you just want to get started using FlashAmp but you want to know what all those buttons do? OK, well this Quickstart guide will help you do just that. First of all you really need to understand what FlashAmp does, if you're not sure then read this. The FlashAmp 3 interface consists of a series of panels each dealing with a particular aspect of the sound or process. The best way to use FlashAmp is to make settings starting with the Input panel at the top of the main window and finishing at the Control panel at the bottom of the window. The topmost panel contains buttons to open the Setup and Help windows. You don't need to change anything in the Setup window to start using FlashAmp and you're already looking at this so you don't need any more Help either. This Quickstart guide will take you through the process of generating amplitude data for a single sound file. 1. InputClick the Select File button and select a sound file to process. For this process try to choose an .mp3 file about 30-60 seconds long, that way the the process will be quick and you can easily try different settings. The selected file's name will appear in the blue field.
2. CommonThe common panel contains settings that are common to all data arrays generated by FlashAmp. For this process, set the Frame rate value to be the same as your Flash movie. It's actually only critical that it's the same value as your Flash movie if your sound is on the timeline – if you're using a Flash sound or loading an external MP3 then you can make this value higher or lower than your frame rate. This setting controls the 'resolution' of the data generated by FlashAmp; how many slices of the sound FlashAmp looks at when it's processing. Leave the Scale value set at the default of 100. This controls the range of the values generated by FlashAmp. Leave Mono button set. This means that FlashAmp will only generate data mono data. The Stereo button is disabled in this case because the sound is mono. Leave the Normalize button off - it's not essential for this process. Switching it on will 'normalize' the sound before it's processed. This will boost the level of the sound to make the loudest part as loud as possible without distorting (also called 'clipping').
3. AmplitudeOK, we want amplitude values so leave the Generate List button selected. Leave all the other settings at their default values. Just so you know, setting Smoothing to a value higher than zero will make the amplitude values less varied - it smoothes the differences so the higher the value, the smoother it makes the overall curves in the values. See the User Guide for information on DB Scaling - it's not simple enough to quickly explain here. Zero Ending effectively 'fades out' the values at the end of the amplitude array to 0 (silence).
4. Cue PointsWe won't process this sound for cue points so leave the Generate List button switched off. The Fill Frames button becomes active when Generate List is switched on. When Fill Frames is on then all elements ('frames') in the cue points array will contain the name of the most recently passed cue point.
5. OutputThe Output panel contains settings for the data files that FlashAmp will create. Leave all the settings as they are. Create File is switched on so a data file will be created. The file format is set to #include which means that the output file will contain the FlashAmp data written as Actionscript so then you only need to add an #include statement in your Flash movie and all the generated data will be available in your published swf. The loadVars() option should be used if you want to load the data at runtime using loadVariables() in your Flash movie. Select Folder allows you to choose an output folder for the data file. By default the output folder is the same folder as the input sound.
6. ControlOK, so the settings are done, now we get the results. Select the Process button in the Control panel. The output data file will be created. It will be named the same as your input sound file with a '.as' extension. You can select the View Data button to see what the output looks like.
At this point you're ready to use the FlashAmp data in Flash. 7. FlashIn order to complete this section you'll need to have FlashAmp registered (or you will only have 10 values in the output arrays) and you'll also need to download a Flash example file here, Mac .sit (480kb) Windows .zip (472kb) This example can be used with Flash MX2004 or later. It handles both spectrum and amplitude data, however the Pro edition of FlashAmp is required to generate spectrum data. The example will automatically adjust to the amplitude-only #include file you've created FlashAmp Standard. If you are using an unregistered copy of FlashAmp then you can still download the example and read this section to get an understanding of how FlashAmp data works in Flash. Unpack the archive and put your .mp3 file in the 'media' folder. Then put your #include file in the same folder as the 'player.fla' file. Open the 'player.fla' file in Flash. Open the script in frame 1 of the 'main actions' channel:
The top of the script looks like this: Change the #include file name to the name of your file. Then select Test Movie from the Control menu. The Flash file will run and load your data, click the the play button and you should see the animated waveform of your sound. Now let's have a look at how the code works in Flash. We're just going to concentrate on the parts of the code that specifically concern FlashAmp. Below the #include statement are some variables that control the display – they're specific to this movie and don't relate directly to the FlashAmp data. The first function is //initialisation function
function init ()
{
var ref : Object = this
//create an empty movieclip to hold our graph data
this.graphHolder.createEmptyMovieClip ('graph', 0)
This sets up an empty movie clip for the display, checks for spectrum data and creates a new sound object. Following this are some functions for handling the buttons on screen that stop/start/rewind the sound and switch between spectrum and waveform displays. The
Further down the script are two functions,
The current sound position is divided by 1000 to find the position in
seconds (because sound.position returns milliseconds) and multiplies that
by
In the
In the
In this case the code loops through the spectrum array for the current
frame incrementing In both cases, the important element is that If you follow the same approach, by finding the current array reference as shown here, then you can control any animation with amplitude data created by FlashAmp Standard.
|
||