Can anybody suggest me way to put audio data received over socket into Audio Queue to play it.
Currently I am using GCDAsyncSocket to send and receive data. I am sending data over socket in audio recorders callback method. I receive data in GCDAyncSocket didReadData: method but after that i dont know how to play it.
Also i would like to know how to do both recording and playing simultaneously with audio queue.
Any help really appreciated.
You can’t put data directly into an Audio Queue. What you can do is to put any data received from the network into your own buffer(s), and then copy data from your buffer(s) inside the Audio Queue buffer callbacks, if there’s enough data.
You can play and record simultaneously using the standard Audio Queue APIs if you set the Audio Session appropriately, but the latency of Audio Queues can be much higher than using the RemoteIO Audio Unit API instead, for record and play. Audio Units also includes an echo canceling unit in recent versions of iOS, which might be useful in simultaneous play and record situations.