A Question about testApp::audioReceived(input, bufferSize, nChannels)

Hi All,
I’m very new to OpenFrameworks and so far I’m very happy I found this amazing toolkit.

I’m trying to do music visualization with FFT all the examples I found use microphone to capture audio with audioReceived function. This is not what I want to do, I want to load a music file, but I don’t understand what does float *input captures. I’m using libsndfile to load data but I don’t quite understand what I’m suppose to pass.
Can anyone tell me what this float pointer “input” stores? and how to load the same data from a wav?

Thank you

Hi karsus,

I do not know very much about libsndfile but I am using ofxMaxim, which is quite easy and nice to use.
It also has fft module so I guess you can use it for your visualisation: https://github.com/micknoise/Maximilian/tree/master/ofxMaxim
It already has some example on how to load and play samples if you are interested ;).

So far I only used it for music playing so instead or messing with audioReceived(input, bufferSize, nChannels), you use audioRequested(output, bufferSize, nChannels).

Hi Meach,
Thank you so much for your help!, I’ll definitely give ofxMaxim a try, as for its fft module, I’m planning to code my own but still I’m sure it will be very helpful when I debug my fft code.

Thanks again :slight_smile: