ofSoundGetSpectrum on iOS

has anyone been able to get sound spectrum from a sound file working on iOS?
it has never been implemented in ofSoundGetSpectrum(), which does nothing.
im just starting to look into it… but was first wondering if anyone got this working?


Try ofxMaxim, it works well on iOS 6 for me.

ok cool, will give it a go.
do you know if its reliable across earlier iOS versions?

just tried ofxMaxim with the latest OF (0073) iOS,
and its throwing a bunch of errors.

has anyone got ofxMaxim working with OF (0073) iOS?

I’m using it on ofx0073 for iOS 6 and everything is fine. dont forget to add the accelerate.framework to your project which may lead some error.
Have no idea about the early version of iOS.
good luck!

Were you able to get this working? I have the addon, but don’t really know how to input the correct data and get fft from it. Also trying to get the sound spectrum from a sound file on iOS.


Have you tried the examples? if yes, what kind of error it is?

Hi pf.zcoder,

I was able to get the examples running on the iPad with OF.0073. But I noticed that when the sound loops and plays a second time, it plays at about 50% speed. This is the code I am using:

void testApp::audioRequested(float * output, int bufferSize, int nChannels){  
    for (int i = 0; i < bufferSize; i++){  
        //sample = beat.play(0.5, 0, beat.length);  
        sample = song.play();  
		//get fft  
		if (mfft.process( sample )) {  
		//play result  
		mixer.stereo(sample, outputs, 0.5);  
		lAudioOut[i] = output[i*nChannels    ] = outputs[0];   
		rAudioOut[i] = output[i*nChannels + 1] = outputs[1];