works for me.
#include <AudioToolbox/AudioToolbox.h>
int main(int argc, const char * argv[]) {
AudioComponentDescription desc = { 'aufx', 'nbeq', 'appl', 0, 0 };
AudioComponent ac = AudioComponentFindNext(NULL, &desc);
AudioComponentInstance au;
OSStatus err = AudioComponentInstanceNew(ac, &au);
if (err) {
fprintf(stderr, "AudioComponentInstanceNew failed %d\n", (int)err);
exit(1);
}
UInt32 formatFlags = kAudioFormatFlagIsPacked | kAudioFormatFlagIsFloat | kAudioFormatFlagIsNonInterleaved ;
AudioStreamBasicDescription asbd = { 48000., 'lpcm', formatFlags, 4, 1, 4, 2, 32, 0 };
UInt32 propSize = sizeof(asbd);
err = AudioUnitSetProperty(au, kAudioUnitProperty_StreamFormat, kAudioUnitScope_Input, 0, &asbd, propSize);
printf("set input format err %d\n", (int)err);
if (err) return 8;
err = AudioUnitSetProperty(au, kAudioUnitProperty_StreamFormat, kAudioUnitScope_Output, 0, &asbd, propSize);
printf("set output format err %d\n", (int)err);
if (err) return 9;
err = AudioUnitInitialize(au);
printf("initialize err %d\n", (int)err);
if (err) return 9;
return 0;
}
set input format err 0
set output format err 0
initialize err 0
Program ended with exit code: 0