Re: AudioQueueNewInput: how to adjust callback rate?
Re: AudioQueueNewInput: how to adjust callback rate?
- Subject: Re: AudioQueueNewInput: how to adjust callback rate?
- From: William Stewart <email@hidden>
- Date: Tue, 20 May 2008 11:27:55 -0700
On May 20, 2008, at 9:47 AM, Jens Alfke wrote:
On 20 May '08, at 9:05 AM, Jeremy Friesner wrote:
I was using an NSTimer for mockup testing and that worked fine, but
I don't just need the callbacks, I also need the audio data
(ideally at <100ms latency).
If you that kind of latency, AudioQueue probably isn't your best
bet. Its priority is simplicity, and part of that is letting you run
your code on the main thread using runloop callbacks. That pretty
much requires using a lot of buffering, because the runloop is
cooperatively scheduled and it's not unusual for it to get blocked
for a few seconds at a time due to user actions.
This kind of frequency should be ok (about 10-12 times a second), but
the priority and tasking of the thread you are using to receive the
buffer callbacks is important and will play a large part in
determining the frequency of the callbacks to you.
So, try creating a thread with a round robin policy and a priority in
the high 50's. Then when you task it (run loop run in mode) have a
look at the time out period you are providing.
Bill
How can I get audio from the microphone without using an AudioQueue?
AudioUnits and background threads. I believe /Developer/Examples/
CoreAudio has sample code showing how to read audio input with
AudioUnits. Unfortunately it's a lot harder than using an AudioQueue.
—Jens _______________________________________________
Do not post admin requests to the list. They will be ignored.
Coreaudio-api mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Coreaudio-api mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden