I thought we could start a new topic for this. I've been looking up some stuff in my spare hours today regarding ways to input WAV/MP3 files, etc, and be able to analyse them in realtime, recognise beats, etc.
This is my simplistic (having not done anything like this before) view of how it would be done:
* Assuming the music tracks wouldn't be stop/started during play, the track can be parsed while each level loads, so not all the work need be done during play.
* A common method for making a simplified model of the audio waveform seems to be Fourier Transforms, with 'Fast Fourier Transforms' (FFT's) being a more simplified but... well, faster... method (ie realtime i believe). Fourier Transforms basically make an approximation of a complex waveform of the actual audio, by adding together a specific number of sine waves of differing wavelengths and magnitudes.
* Analysis of the FFT's allow recognition of spikes in audio in certain wavebands and at certain volumes.
I've added some links here for reading and discussion. I'm still looking into a good way for us to use it, but I've heard it mentioned as having been done using FMOD.
Some of the link contents are fairly simplistic, but will help you get the basic picture. There's some good stuff in the rest, and I'm still yet to finish reading read all of it.
Reading/Writing WAV files:
* http://www.transcendentaxis.com/dthompson/blog/archives/14 (this one uses Actionscript, but still good to read).
Anyways, have a look if you like, and let me know anything else you've found. This may not even be the best way to go, but in my searching today it seemed to be a commonly-used method. Hopefully I'll be able to finish reading them all tomorrow.
I'll see if i can dig up my uni notes on Fourier Series, but there may already be functions to generate some of this without us having to delve lots into the fourier side of the maths at least.