I have set up a TCP connection between two iPhones and I am able to send NSData packages between the two. I would like to talk into the microphone and get the recording as an NSData object and send this to the other iPhone. I have successfulyl used Audio Queue Services to record audio and play it but I have not managed to get the recording as NSData. I posted a question about converting the recording to NSData when using Audio Queue Services but it has not got me any further.
Therefore I would like to hear if there is any other approach I can take to speak into the microphone of an iPhone and have the input as raw data?
Update:
I need to send the packages continuous while recording. E.g. every second while recording I will send the data recorded during that second.
NSUInteger length = inNumberPacketDescriptions * 2;
NSData *packet = [NSData dataWithBytes:inBuffer->mAudioData length:length];
. Is that right? I multiply by two because this should be the amount of bytes in each of my packets (this is set in theAudioStreamBasicDescription
) According to idevhub.com/exploring-iphone-audio-part-1 EDIT: It seems that I cannot callself
in my callback, though. – Strutting