I use AudioUnit to record and play audio with 8 KHz samplerate and 8 bits audio sample. I use the example from the following source: https://github.com/fuxx/MicInput
The playback part is based on a callback pattern. With this method, I don't have control on when to play audio, the Core Audio calls the callback when it needs more audio data to be played.
The thing is, I get audio data from the network and thus can't promise to have the audio data ready for the next callback. Sometimes, the callback misses the audio data from the network and so there's a gap of around 20 ms which sounds like a click.
Is it possible to render audio immediately without waiting for a callback? With AudioQueue it's possible by calling AudioQueueEnqueueBuffer(), I don't know how to that with AudioUnit. I hope you can help me.