Re: Sample Rate Conversion using AudioConverter
Re: Sample Rate Conversion using AudioConverter
- Subject: Re: Sample Rate Conversion using AudioConverter
- From: Tommy Braas <email@hidden>
- Date: Mon, 16 Jun 2003 14:26:39 -0700
- Resent-cc: Tommy Braas <email@hidden>, coreaudio-api <email@hidden>
- Resent-date: Mon, 16 Jun 2003 15:13:22 -0700
- Resent-from: Tommy Braas <email@hidden>
- Resent-message-id: <37B9DA8A-A041-11D7-898D-000393D7A8AE@deepseasoftware .com>
- Resent-to: Bill Stewart <email@hidden>, James McCartney <email@hidden>
Bill and James,
Thank you both for your most excellent help!
I think I have managed to resolve all my conversion issues using caches
and threads.
It would be extremely helpful if the AudioConverter.h was filled out
with something like...documentation though! ;-)
Thanks again!
Kind regards,
Tommy Braas
On Monday, Jun 9, 2003, at 19:13 US/Pacific, Bill Stewart wrote:
On Monday, June 9, 2003, at 02:35 PM, Tommy Braas wrote:
Bill,
You're a very funny guy! ;-)
I try, dismally pathetically really...
So, I have set up some code to use the AudioConverterFillComplexBuffer
and its callback.
New problems! I am probably setting something up incorrectly (or so I
hope...). When the callback is called, the
AudioBufferList.mBuffers[0].mData is NULL!
Yes - the input proc is giving you a place ot put the data, but not the
space to put it in... as it can't know how much input you are going to
give it...
In the SDK - have a look a AUBuffer - in the AUPublic directory...
renderABL.Allocate (theASBDesc, processPackets);
renderABL.PrepareBuffer (theASBDesc, processPackets);
This will prepare an AudioBufferList based on the description you give
it (which is your source description from the AudioConverterNew call)
and it will allocate the memory in the PrepareBuffer call.. (Allocate
actually allocates the BufferLIST, not the buffers themselves....)
PrepareNullBuffers will give you back the kind of buffer list you are
seeing now - ie. a buffer list with NULL mData values...
processPackets above is (for PCM) the number of sample frames you have
(say 512 - which if stereo is 512 left-right pairs)
Now - this is NOT the buffer list that you pass in when you call the
AudioConverterFillComplexBuffer - on this side (the output side) you
also have to allocate the memory that you want filled by the conversion
- so you can't pass a buffer list with NULL buffers there either...
Hmmm... I think its easy if I post a simple example - I'll do that
soon...
Bill
_______________________________________________
coreaudio-api mailing list | email@hidden
Help/Unsubscribe/Archives:
http://www.lists.apple.com/mailman/listinfo/coreaudio-api
Do not post admin requests to the list. They will be ignored.