Reputation: 592
Currently i'm using Novocaine in several apps for different reasons. Thanks to Alex for the great framework! Thanks to Nick D. for the making it arc also!
I can get samples using the basic play thru example like this:
[self.audioManager setInputBlock:^(float *data, UInt32 numFrames, UInt32 numChannels) {
NSMutableData *theData = [NSMutableData dataWithBytes:data
length:(numFrames* numChannels*sizeof(float))];
}];
Then i'm sending the data through a socket stream using GCDAsyncSocket
On receive the data i'm putting it to the ring buffer
float *floatData = (float*)[theData bytes];
_ringBufferOut->AddNewInterleavedFloatData(floatData, numFrames, numChannels);
And playing it like this:
[audioManager setOutputBlock:^(float *outData, UInt32 numFrames, UInt32 numChannels) {
_ringBufferOut->FetchInterleavedData(outData, numFrames, numChannels);
}];
My best try was to receive just few seconds of sound (depending on the size of my buffer) and than just glitches or no sound...
I'm completely new in using buffers at all and i already spent several days trying to configure out how to accomplish this.
My questions are: is it possible to use just Novocaine and its ringBuffer to stream audio between iPhone devices? Should i go AudioQueue instead like Speak Here example? Maybe combine them both? I understand that my problem is using buffer so any help with buffering is very much appreciated.
Upvotes: 1
Views: 693