SFML community forums
Help => Audio => Topic started by: Mind Calamity on November 20, 2011, 04:29:43 pm
-
So, I've been trying to make an application that needs spectrum analysis, and not paying $200+ (or 6000 in the case of FMOD), so after a bit of researching I concluded that SFML will probably be the best choice for me, so now the problem is: How ?
I have no idea how to do it, all I know is I need to implement the FFT algorithm and use it with the sound buffer samples, or so I read in a thread similar to mine, to be precise it said:
1. Get playing offset
2. Get small amount of samples starting from that offset
3. Use FFT on those samples
4. Visualize
Does anyone have any idea how to do that ?
I've been thinking of using FFTW for FFT, but it's C, which I don't really like, and it seems like it's pretty tricky to compile with VS, I also found FFTReal (http://ldesoras.free.fr/prod.html), which is C++, but I still have no idea how to use it, as it has no tutorials, nor documentation, so yeah...
I'm open to suggestions, also if anyone is going to suggest another library, I need it to be free for commercial use.
-
What have you already tried? What don't you understand exactly? We're not going to write the full code for you ;)
FFTW is the most popular library for FFT. What's the problem with C? I think it's ok for low-level libraries that provide very precise functionality. It's not as if we were talking about a full game framework ;)
-
What have you already tried?
As I have no idea where to start, I haven't tried anything, I'm currently searching for an "easy" way to use FFTW, by easy I mean under 300-500 lines properly written/formatted/understandable code, after that I'm planning to actually try to compile FFTW, as it's primary platform seems to be GCC and Linux, it's not that straight-forward to compile it on Windows.
(Everyone should start using CMake IMO)
FFTW is the most popular library for FFT. What's the problem with C? I think it's ok for low-level libraries that provide very precise functionality. It's not as if we were talking about a full game framework ;)
The problem with C is, it's not C++ (which I'm used to, and am probably too lazy to drop my habits).
What don't you understand exactly? We're not going to write the full code for you ;)
That's obvious, so I wasn't expecting it. ;)
As for what I don't understand, I haven't tried much, yet, but I'm going to give FFTW a try now, if I encounter any trouble on my way of using the both libraries together, or actually succeed in it, I'm going to report back with code and a detailed explanation on the problem/solution.
In the mean time, if anyone has some code from their previous/current project, feel free to donate, if you feel like it.
Whoops, I failed to notice that FFTW was GPL, so it's out of the question, FFTReal remains, and is under the WTFPL, and I think it will suffice, once I figure out how to use it.
Update: FFTReal is used in the Qt spectrum demo (http://doc.qt.nokia.com/4.7-snapshot/demos-spectrum.html), time to try and adapt it to SFML.
-
C compiles in C++. Make a class, which utilizes FFT library. What is the problem?
-
Also look at CLAM C++ library.