I\'m using the Audio Queue Services API to play audio streamed from a server over a TCP socket connection on an iPhone. I can play the buffers that were filled from the socket c
Try changing self
for (void*)self
. Like this:
status = AudioQueueNewOutput(&_streamDescription,
AQBufferCallback,
(void*)self,
CFRunLoopGetCurrent(),
kCFRunLoopCommonModes,
0,
&_audioQueue);
Is this executed on the main thread or a background thread? probably not good if CFRunLoopGetCurrent()
returns a run loop of a thread that could disappear (thread pool etc) or is a run loop that don't care about kCFRunLoopCommonModes
.
Try to change CFRunLoopGetCurrent()
to CFRunLoopGetMain()
or make sure AudioQueueNewOutput()
and CFRunLoopGetCurrent()
is executed on the main thread or a thread that you have control over and has a proper run loop.