portaudio

I am trying to use portaudio (being cross platform capability), to read in from microphone, then i want to put that data through a FFT, but i am not so sure how to do it. Alot of people have told me: 1.get the data, 2.apply fft, but the problem is i am not so sure how to get the data, portaudio doesn't have much tutorials on grabbing input from mic, if you know any code, tutorials or any other resource it would be great full. I been searching on this for a while now. Please help
I have never used this library, but I think you need to:

1. Call Pa_GetDefaultInputDevice() to get the device ID of the default input device (which I assume is the microphone).
2. Call Pa_GetDeviceInfo() to obtain certain information needed in step 3.
3. Call Pa_OpenStream() to obtain a PaStream object that represents the microphone input.
4. Call Pa_ReadStream() to read from the stream.
how do i apply fft, to the raw data from the stream?
http://en.wikipedia.org/wiki/Fast_Fourier_transform

Take your pick of algorithm and program it. If you are looking for information on how to apply this to the byte array, well, I don't know that part as I have never worked with an audio stream before (or FFT's for that matter). That would be up to you to solve.
i am quite comfortable with FFT on paper (and in matlab)-i don't know how to due to an array of floats.
Well, quickly glancing the Wikipedia article, the DFT definition applies over a set of coordinates. Your byte array (that I guess represents an array of floats) is just that: An array of points. I did not check the FFT algo's, but I suppose they work on the same input, so there you go.
if any one is interested there is a very good C library (can be used in C++ and etc) called FFTW, under \gnu
Topic archived. No new replies allowed.