A Flash Developer Resource Site














Internet Commerce

Partners & Affiliates














Developer Channel

internet.com


Featured Flash FLA
Gallery Downloads 11336 Flash Movies | 2 New Flash Movies Added
What's New | Top 100

Featured FLA

» Author: Surjit Dhami
» Title: Book
» Description: Book
» More by Surjit Dhami


Random FLAs | Add Flash Movie
Featured Flash Site
Gallery Downloads 5848 Flash Sites | 0 New Flash Links
What's New | Top 100 Flash Site

Featured Site

» Posted in the Flash Kit Links section
» Title: All-American Rejects
» Description: Get to know this great band by exploring their "practice room".


Random Links | Add your own Flash Related Links
Flash Tutorials 1277 Tutorials 7 New Tutorials Added!
What's New | Top100

» Create xml slideshow with free template
» How to Insert a Multilingual Subtitle Into Your Flash Video Studio
» How to Create Cool Halloween Slideshow
» Debugging flash using the Firebug console
» Create Flash Slideshow on Blogger
» FLASH TRICKS IN WEB ADVERTISING: FLASH BANNERS
» HTML Photo Gallery Tutorial
» Create your first flash site – PART 1
» How to Make a Flash Photo Gallery
» Unknown Tag: Title10
Random Tutorial | Add Site

Sr Instructional Designer D2L-Moodle,Clearance
WSI Nationwide, Inc.
US-NJ-Fort Monmouth

Justtechjobs.com Post A Job | Post A Resume


Tutorials Home What's New Top Rated Submit myTutes Random!

Search Tutorials


Tutorials Tutorials » Audio

Categories Flash Audio Spectrum Analyser
Author: Inn Chan

 
Page 4
«prev 1 2 3 4

Using Spectrum Lab to generate spectrum data

Spectrum Lab is a specialized audio analyser, it also has many other advance features, amongst which the powerfull data logging feature. It allows you to set the interval in miliseconds at which data is written to the text file and how many frequency bands you want to log and the range.
This tutorial will only cover up to what you need to obtain the spectrum data. The rest are left for you to explore.

So here is what you do: open the Spectrum Lab program, you will see something like the following, first of all go to "option" -"audio setings" as follows:



The configuration and display control panel comes up, set the sample rate to 44100Hz or 22050Hz, just make sure it's over 16000Hz.



Then in the same panel, go to Spectrum display and type in "93" under Waterfall Scroll Intv., make sure it's in millisecond. You can try out other values for the interval, the smaller the value is the largerer the text file it generates. A 1 min track analysed with 93ms interval results in a 14K text file which took 3 seconds for a 512M Ram PII 400MHz to load the file from hard drive, just over a second in a PIII 1.2GHz, whereas 100ms interval yields a 8K txt file, and 90ms yields 27K



In the same panel again, go to the Wave setting change the speed under the "File Analysis w/o audio reply" to Fast. Choosing this setting will speed up the analysing time, it does not affect the output of the log file.



After setting up the Spectrum Laboratory, we have to define the format of the output data, go to "File"-"Text file export" then the "File Contents" section and enter the parameters as follows:



When you are ready to analyse the wave file, go to the "File Export Format" panel (same as above) and go to the "Filename & Action" section. Enter the path and file name of the data file then check the Active check box to toggle the output mode. When the box is checked, the data file is locked and ready for data logging, and only Spectrum Lab can write data to the file. Spectrum lab append data to the end of the file, so make sure the data file donesn't contain spectrum data from previous runs.



Now every thing is ready, make sure you have activated text file export then go to "File"-"Wave Files"-"Analyze input from *.WAV-file", the audio File analysis panel will pop up. Now choose 1024 pts for the FFT option and press ok, you will see the spectrum graph starts to jump. when it stops jumping, that's when it finishes analysing the wav file.



Open the data file in notepad, you should see some thing like this:



Delete the first line which says ",,,,,,,,,", that's the names of the columns, since we didn't declare it in "File Export Format", only the separaters were written to the file. Now type in "sdata=" infront of the first row of data, and add "&loadstatus=1" to the last line, make sure there are no carrage returns nor spaces after that and save the the file as "data.txt" in the track directory:



So there you are, go to your swf directory run the Spectrum Analyzer.swf and see your own flash audio spectrum analyser in action.

As you may have noticed the way in which the spectrum data are organised and that it is an external source to the movie hugely increases the processing load. One way to reduce this load is to find another spectrum analysing program that interprets data in different scale, currently Spectrum Lab only measure amplitude in db and percentages, where db ranges from 0db to -140db, the negative number means there is one "Extra" character in each data entry, and percentage ranges from 0 to some big numbers far beyond 100 which is even worse for our case. Ideally we would have used the scale 0-9 to represent the amplitude of a specific frequency band, such scale will result in a reduction of 3/4 to the current file size. Another way to achieve that is to write a mini program and use string manipulation to organise the spectrum data. And by declaring the data as a variable from within the flash movie rather than loading it from an external source, runtime performance can be noticeably boosted up.

Coming Up Next

Fed up with volume sliders? How about a volume roller like the one on your Hi-fi system? It can be used to build a scratchable vinyl turntable too.

Here is an experimental piece I created with this roller.



Tutorial coming soon.

«prev 1 2 3 4

» Level Intermediate

Added: : 2002-08-28
Rating: 8.75 Votes: 32
Hits: 3387
» Author
Multimedia Student eager to combine artistic skills, creativity and practical knowledge to innovate new concepts in interactive media
» Download
Download the files used in this tutorial.
Download (350 kb)
Get conversion and unzipping tools for PC and Mac here!

» Forums
More help? Search our boards for quick answers!

Please rate this tutorial, 10 is the top rating, you can also click the comments link to read/write a review.
10 9 8 7 6 5 4 3 2 1
Read or Post Comments
 
   
 

internet.commediabistro.comJusttechjobs.comGraphics.com

Search:

WebMediaBrands Corporate Info

Legal Notices, Licensing, Reprints, Permissions, Privacy Policy.
Advertise | Newsletters | Shopping | E-mail Offers | Freelance Jobs