i manage to get the recordCallBck and deal with the buffer data.
now i want to play that data.
i have the play callback but i just cant find anywhere how to play this buffers.
callback:
static OSStatus playbackCallback(void *inRefCon,
AudioUnitRenderActionFlags *ioActionFlags,
const AudioTimeStamp *inTimeStamp,
UInt32 inBusNumber,
UInt32 inNumberFrames,
AudioBufferList *ioData) {
for (int i = 0 ; i < ioData->mNumberBuffers; i++){
AudioBuffer buffer = ioData->mBuffers[i];
unsigned char *frameBuffer = buffer.mData;
now what?
how would i play that?
have a look at this example, helped me out a lot when trying to deal with the data. This is an example of a working app that plays anything you have spoken into the microphone. It uses 2 callbacks, one for recording the data and placing in a global audio buffer and a second for getting that data back into the playback callback.
http://www.stefanpopp.de/2011/capture-iphone-microphone/