Why might my AudioQueueOutputCallback not be called?

前端 未结 2 993
离开以前
离开以前 2021-02-06 12:49

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

2条回答
  •  [愿得一人]
    2021-02-06 13:19

    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.

提交回复
热议问题