Things stopped playing through after the downsample was successful because i was using
CheckError(AudioQueueNewOutput(&recordFormat,
MyAQOutputCallback,
(__bridge void *)self, NULL, NULL, 0,
&playerQueue), "AudioOutputNewQueue failed");
rather than
CheckError(AudioQueueNewOutput(&outFormat,
MyAQOutputCallback,
(__bridge void *)self, NULL, NULL, 0,
&playerQueue), "AudioOutputNewQueue failed");
remembering that record format is
and outFormat is
and when i changed the audioQueue to use the 8000 sampling rate mono audio thats when playthrough playback was choppy.
but it sounds like you are saying of it the playback isnt choppy because of the sampling rate its because of my buffer sizes and when im doing the output callbacks?
its strange because before downsampling all of this worked flawlessly, so didnt imagine there was a problem doing the allocations for the queue in the input callback. i hope im being completely clear with what im doing and when problems have arisen.
On Jan 8, 2014, at 9:22 AM, Dave Bender <
email@hidden> wrote:
I feel your pain. OK here are a few things I would change:
AudioQueues are finicky things, and input callbacks should not touch output queues. Your callback is already in an AudioQueue stack frame, and you risk reentering the AudioQueue code and causing havoc. So:
-Do not schedule output in your input callback, use performSelectorOnMainThread and intermediate function to do that task
-Do not call AudioQueueAllocateBuffer in your input callback. Preallocate a pool of output buffers and use those.
As for debugging tips:
-Try to record your output sound on another machine. See if there is a pattern in how long each burst of static lasts and if it relates to your buffer size.