RE: Determining buffer playback status / position
RE: Determining buffer playback status / position
- Subject: RE: Determining buffer playback status / position
- From: "Stephen Shaw" <email@hidden>
- Date: Tue, 10 Jan 2006 12:13:07 -0800
- Thread-topic: Determining buffer playback status / position
> AUConverter's (as with any other AU) will provide buffers for you to
> fill in the render callback. These buffers are owned by the AU.
I wasn't aware of that, In the sample PlayAudioFileLite, it showed a
buffer being allocated and assigned to an element of the
AudioBufferList.
ioData->mBuffers[0].mData = gSourceBuffer;
ioData->mBuffers[0].mDataByteSize = bytesReturned;
I had assumed that the graph was being feed the memory range specified
by my ptr (gSourceBuffer) directly (unless it's being copied to private
buffers internally immediately when submitted).
My problem is that I have one subsystem which is returning audio in a
sequence of 'n' buffers in a list. It treats the list like a ring and
when finished with the 'n'th buffer it returns to buffer element 0 to
start filling there again.
Something along the lines of this (an example):
UInt8* buffArray[10];
For (int I = 0; I < 10; i++)
buffArray[i] = calloc (512, sizeof (UInt8));
when my callback is called by the audio unit, I return it a ptr in the
AudioBufferList to my current location in buffArray[0] until it's
exhausted and then I increment to buffArray[1] and so on until
buffArray[9].
Meanwhile the audio generation subsystem (which owns the buffers) is
filling those buffers ahead of me, but when it is done with
buffArray[9], and before it starts filling buffArray[0] again, it needs
to know that I'm done with the playback from that buffer (buffArray[0]).
While I'm feeding the buffers to CoreAudio, I need to know that it is
done accessing the data from the buffArray[0] memory range so that it
can be reused.
I know this all probably sounds strange and obtuse, and I'm trying to
describe it as best I can with the example :). Besides the fact that I
don't own the buffers, I'm trying to avoid a memory copy into a double
buffer.
Thanks,
Stephen
-----Original Message-----
From: William Stewart [mailto:email@hidden]
Sent: Tuesday, January 10, 2006 11:40 AM
To: Stephen Shaw
Cc: CoreAudio API
Subject: Re: Determining buffer playback status / position
We don't provide any direct means
AUConverter's (as with any other AU) will provide buffers for you to
fill in the render callback. These buffers are owned by the AU.
What exactly is the question you are asking? Which buffers and from
where...
Bill
On 10/01/2006, at 11:30 AM, Stephen Shaw wrote:
> I have an audio graph which I'm feeding with a Render Callback that
> I have set on the audio converter at the head of my graph.
>
>
>
> AU Converter -> Stereo Mixer -> AU Output
>
>
>
> I'm feeding the converter with a series of buffers, when finished
> feeding one, I skip on to the next one.
>
>
>
> My problem is that I need to know when a buffer in the series has
> been feed completely through the graph so that I can release it for
> re-use. What is the best method for me to determine the status of
> an audio unit or graph in relationship to the buffers I've fed it.
> Is there a way of setting a playback complete event with the
> buffer? I searched the archive and unfortunately wasn't able to
> find anything that appeared pertinent to my situation.
>
>
>
>
>
> Thanks.
>
> Stephen.
>
> _______________________________________________
> 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
--
mailto:email@hidden
tel: +1 408 974 4056
________________________________________________________________________
__
"Much human ingenuity has gone into finding the ultimate Before.
The current state of knowledge can be summarized thus:
In the beginning, there was nothing, which exploded" - Terry Pratchett
________________________________________________________________________
__
_______________________________________________
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