[AudioConverterFillComplexBuffer] kAudioConverterErr_InvalidInputSize
[AudioConverterFillComplexBuffer] kAudioConverterErr_InvalidInputSize
- Subject: [AudioConverterFillComplexBuffer] kAudioConverterErr_InvalidInputSize
- From: "Malik 522" <email@hidden>
- Date: Wed, 19 Oct 2005 10:29:12 +0000
Hi
I'm using AudioConverterFillComplexBuffer to convert my audio buffer in a
specific format, but it fails and return this error :
kAudioConverterErr_InvalidInputSize. I dont know why I have this error, but
it seems that it does not accept 512 packets, so how can I use this function
?
My code :
===========================================
/*** Callback Function ***/
OSStatus err= noErr;
void *inInputDataProcUserData=NULL;
int i;
AudioUnitRenderActionFlags flags;
AudioStreamPacketDescription* outPacketDescription = NULL;
inNumberFrames = 512;
flags = 0;
ioData = (AudioBufferList *)malloc(offsetof(AudioBufferList, mBuffers[1]));
ioData->mNumberBuffers = 1;
for (i = 0; i < 1; i++)
{
ioData->mBuffers[i].mNumberChannels = 1;
ioData->mBuffers[i].mDataByteSize = 2048;
ioData->mBuffers[i].mData = NULL;
}
err = AudioUnitRender(theInputUnit, &flags, &myTimeStamp, inBusNumber,
inNumberFrames, ioData);
err = AudioConverterFillComplexBuffer(converter,
ACComplexInputProc,
inInputDataProcUserData, /// null here
&inNumberFrames,
ioData,
outPacketDescription /// null here
);
if(err == kAudioConverterErr_InvalidInputSize)
//AudioConverterFillComplexBuffer fails and returns
kAudioConverterErr_InvalidInputSize...
{
printf("MacOSXWaveIn.cpp - InputProc - Error
AudioConverterFillComplexBuffer - kAudioConverterErr_InvalidInputSize\n");
}
===========================================
/*** ACComplexInputProc Function ***/
OSStatus ACComplexInputProc(AudioConverterRef inAudioConverter,
UInt32 *ioNumberDataPackets, /// data quantity
AudioBufferList *ioData, /// data out (converted)
AudioStreamPacketDescription **outDataPacketDescription, /// not needed
void *inUserData /// not needed
)
{
//in this function, ioData is NULL, strange...
}
===========================================
Malik
_______________________________________________
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