Re: crashing in calls to AudioConverter on 10.3.9
Re: crashing in calls to AudioConverter on 10.3.9
- Subject: Re: crashing in calls to AudioConverter on 10.3.9
- From: Doug Wyatt <email@hidden>
- Date: Tue, 28 Mar 2006 18:03:50 -0800
On Mar 28, 2006, at 17:48, Christopher Ashworth wrote:
On Mar 28, 2006, at 8:34 PM, William Stewart wrote:
The ABL you provide in your input callback has to be properly
filled out based on the format you specified as the source format
for the converter.
num channels, num buffers - you need to fill in all of the ABL
fields here and make sure they are accurately set.
Sorry to be dense, but this is what I don't understand; the num
channels is now set correctly, and there is only one buffer to
provide--the one being produced by AudioFileReadPackets.
The converter input is mono 8-bit PCM @ 11.025 kHz according to your
earlier debug information.
So the file should be mono. If you are reading a file from your
converter's input proc, the crucial things to be sure of are:
OSStatus MyComplexInputDataProc)(UInt32 *ioNumberDataPackets ...
AudioBufferList *ioData ...)
{
AudioBufferList abl;
abl.mNumberBuffers = 1;
abl.mBuffers[0].mNumberChannels = 1;
abl.mBuffers[0].mData = <something you malloc'd, probably earlier>;
abl.mBuffers[0].mDataByteSize = <the number of bytes you want to get
back from the file>;
AudioFileReadPackets( ... &abl ...);
*ioData = abl;
*ioNumberDataPackets = <number of frames>;
}
You are responsible for not deallocating or altering this buffer
until your input data proc is called again, or you return from
AudioConverterFillComplexBuffer and not call it again for that
converter, at least not without resetting it first.
I sense a forehead-smacking moment coming on....
If that doesn't explain what you're seeing then we're into the realm
of suspected memory corruption.
In that case I'd suggest making the simplest possible input proc for
this AudioConverter -- return valid data in chunks the same size as
if you were reading from the file, but don't actually read from the
file or do anything else. Does it still crash?
Doug
--
Doug Wyatt
Core Audio, Apple
_______________________________________________
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