for an iphone voice changing app (objective c), i am trying to take the sampled integer values from the recording audio queue buffer, process them in a function and write the modified values back to the play back buffer. At the moment i use something like this
AudioBuffer audioBuffer = bufferList->mBuffers[0];
int bufferSize = audioBuffer.mDataByteSize / sizeof(SInt32);
SInt32 *frame = audioBuffer.mData;
SInt32 signalInput[22050];
for( int i=0; i<bufferSize; i++ ) {
SInt32 currentSample = frame[i];
*(signalInput +i) = currentSample;
}
to extract the sampled values and seems to work pretty fine (signalinput is supposed to be the target vector for writing the integer samples). but writing them back to a buffer is still a problem... i searched the documentation and lots of forums to find a solution, but didnt succeed yet.
so id be very thankful for any advice, thanks in advance, lukas