Unexpected behavior with AudioQueueServices callback while recording audio
Posted
by rcw3
on Stack Overflow
See other posts from Stack Overflow
or by rcw3
Published on 2010-03-26T04:23:45Z
Indexed on
2010/03/26
4:33 UTC
Read the original article
Hit count: 504
I'm recording a continuous stream of data using AudioQueueServices. It is my understanding that the callback will only be called when the buffer fills with data. In practice, the first callback has a full buffer, the 2nd callback is 3/4 full, the 3rd callback is full, the 4th is 3/4 full, and so on. These buffers are 8000 packets (recording 8khz audio) - so I should be getting back 1s of audio to the callback each time. I've confirmed that my audio queue buffer size is correct (and is somewhat confirmed by the behavior). What am I doing wrong? Should I be doing something in the AudioQueueNewInput with a different RunLoop? I tried but this didn't seem to make a difference...
By the way, if I run in the debugger, each callback is full with 8000 samples - making me think this is a threading / timing thing.
© Stack Overflow or respective owner