Re: Passing parsed packets from Audio File Stream Services to Audio Queue
Re: Passing parsed packets from Audio File Stream Services to Audio Queue
- Subject: Re: Passing parsed packets from Audio File Stream Services to Audio Queue
- From: Doug Wyatt <email@hidden>
- Date: Mon, 9 Nov 2009 10:11:08 -0800
On Nov 8, 2009, at 22:26 , Rick Mann wrote:
When streaming, how do I determine an appropriate Audio Buffer Size?
It seems like the parser callback provides the data for a direct
call to AudioQueueEnqueueBuffer(), but as I understand it, I'm not
supposed to call that until the Audio Queue calls me back. Which
suggests I have to buffer the data in the first callback and make it
available in the second.
I don't have good answers for your other questions right now, but I
can speak to this. With AudioQueue, you are free to use any strategy
you like for allocating, scheduling and disposing of buffers. It turns
out to be simple and convenient when playing from a file to have a
small pool of buffers, and then daisy-chain, from the buffer
completion callback, a read from the file, followed by re-enqueuing
the buffer.
You could however use a completely different strategy, e.g. allocate
and enqueue buffers as data arrives from the network, and dispose the
buffers when they are completed.
hth,
Doug
_______________________________________________
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