07-20-2011 06:14 PM
Does anyone know if you can perform an FFT operation on an MP3 file? I don't want to (and can't) play the file, I just want to read it and perform the FFT.
Thanks!
-Matt
07-21-2011 07:07 AM
To perform an FFT you will need the rawaudio content (usually interleaved WAVE format), and to get that you will need to decode the MP3 content. Although you won't be 'playing' the MP3, you'll need to effectively perform 90% of the same processes as an app that would. Decoding MP3's isn't easy, but should technically be doable using a third-party library such as FFMPEG, although this could be a lot of work.
I believe I read something once about an MP3 compatible plugin somewhere on the NI website, maybe that's a starting point?
07-21-2011 11:27 AM
Funny you should mention FFMPEG -- that's what I'm using to create the MP3 file in the first place. Are you saying that there's another format that would be easier? If that's the case -- GREAT.
I looked up the MP3 compatible plugin -- looks like it's more about playing MP3's than analyzing them.
07-21-2011 01:16 PM
If you are using raw wave files to rip your MP3s you should analyze them instead of going through the trouble of decoding the MP3s. Look at the example called Read Sound File to Chart.vi to see how to extract the left and right channels of wave data, then do your FFT on the arrays.
07-21-2011 01:28 PM
Unfortunately, I have a video file. I'm using FFMPEG to break out the video (actually into individual JPG's) and audio (as an MP3 file).
07-21-2011 01:39 PM
I've never really used it but I'm pretty sure FFMPEG supports .wav format for audio output. Here is a link to their doc page: http://ffmpeg.org/ffmpeg-doc.html#SEC1