This project has moved. For the latest updates, please go here.

Get FFT from any part of the pcm data

Aug 11, 2013 at 4:59 PM
Hi.
I just need to get fft from any part of my music.
For example the whole, seconds 30-50 etc then save the fft data in an array.
Cause almost all the common using files are mp3, I first convert it to wav. Beside.
Mp3FileReader mp3 = new Mp3FileReader("test.mp3");
WaveStream pcm = WaveFormatConversionStream.CreatePcmStream(mp3);
Coordinator
Aug 20, 2013 at 3:22 PM
Mp3FileReader already emits PCM.
I'd then convert to a Sample provider (see SampleProviderConverters.ConvertWaveProviderIntoSampleProvider), so you can easily read out floating point samples and pass them into the FFT. You typically perform FFT on a smaller section than 20 seconds at a time. For example 1024 samples at a time (it has to be a power of 2).