Re: AudioConverterConvertBuffer
Re: AudioConverterConvertBuffer
- Subject: Re: AudioConverterConvertBuffer
- From: Doug Wyatt <email@hidden>
- Date: Mon, 2 Jan 2006 15:36:02 -0800
On Dec 29, 2005, at 2:06, George Malayil-Philip wrote:
Hi,
Yet again trying to convert a buffer of BEF32 to
BEI32...running out of
ideas here :)
Tried
AudioConverterRef audioConverter;
AudioConverterNew(&inputFormat, &outputFormat, &audioConverter);
from a AudioBufferList
AudioBufferList* toConvert;
int dataSize = toConvert->mBuffers[0].mDataByteSize;
void* buffer_l = malloc(dataSize);
void* buffer_r = malloc(dataSize);
err = AudioConverterConvertBuffer(
audioConverter,
toConvert->mBuffers[0].mDataByteSize,
toConvert->mBuffers[0].mData,
&dataSize,
(void*)buffer_l);
This convert call however terminates with EXC_BAD_ACCESS in a
FloatToNativeInt32_Altivec(or something similar) function.
This to me indicates I am having some kind of uninitialized memory
problem.
But for the life of me I can't figure out what...But the output
buffers seem
to be initialized and the dataSize is set correctly, and the input
buffers
point to valid data too...any advice on this much appreciated.
This should work.
You don't show us what the AudioStreamBasicDescriptions are.
This would:
CAShow(audioConverter);
I could imagine something going wrong like this if one of the formats
is interleaved and the other non-interleaved ... in which case you
really need to be using AudioConverterConvertComplexBuffer anyhow.
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