![]() |
||
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 and spectrum 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. Amplitude
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. Spectrum
Switch on the Generate List button. Leave all the other settings at their defaults. The Bands value sets the number of frequency bands that will be generated – in this case 8. The Custom button allows you to set custom band widths – usually you will get good results without using this. The Low and High frequency values control the range of frequencies in the sound that will be analysed. Switching Log Bands on will spread the bands logarithmically over the range so the lowest band is the widest and each band gets progressively smaller as the frequency increases. Scale All scales each band independently to the highest value in the band - when this button is off then the values are scaled to the highest value found in every band.
5. 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.
6. 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.
7. ControlOK, so the settings are done, now we get the results. The Process button will simply create the output file ready for use in Flash. The Preview button will open the Preview window so you can see an animated display of the spectrum and amplitude data with the sound playing. Previewing effectively processes the sound file so selecting Process after closing the Preview window just writes the data file without re-processing. Select the Preview button. The Preview window opens and spectrum data will be processed and displayed as the sound plays. The Preview window allows you to make an easy visual check of the spread of spectrum and amplitude values. You can stop and start the preview using the button at the lower left of the window and you can drag the window by the title bar at the top. The overall spectrum frequency range (10Hz-10kHz) is shown along the top of the display area. The individual band width frequencies are shown along the bottom of the display area, as you can see, the 8 bands are evenly distributed over the frequency range. The Bands buttons switch between the Default and Custom displays. Custom allows you to drag each band to create custom band widths. The Scale buttons switch between Linear and Logarithmic displays. Select the Amplitude tab at the top of the Preview window. The amplitude data is processed and the moving waveform along with a sound level bar is displayed as the sound plays. You can switch between a Moving and Complete waveform display using the Waveform buttons. Select the Done button to close the Preview window. Then 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. At this point you're ready to use the FlashAmp data in Flash. 8. 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) 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. This example can be used with Flash MX2004 or later. 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 - quite a lot of the code generates and handles the waveform and spectrum displays. 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 or spectrum data created by FlashAmp Pro.
|
||
![]() |