RenderInput not working properly
RenderInput not working properly
- Subject: RenderInput not working properly
- From: Sanoj Nambi <email@hidden>
- Date: Wed, 30 Jun 2010 15:11:43 -0500
Hey,
I am working on integrating two sound files.I am able to achieve it on simulator however iphone device fails to run it.
After debugging I released that it stops at RenderInput Callback function(same as multichannelMixer example on apples developer site) .
The strange part is that the example at developer site is working fine on iphone.
Can anyone tell me why it is happening.
Here is the code snippet:
static OSStatus renderInput(void *inRefCon, AudioUnitRenderActionFlags *ioActionFlags, const AudioTimeStamp *inTimeStamp, UInt32 inBusNumber, UInt32 inNumberFrames, AudioBufferList *ioData)
{
SndBufferPtr sndbuff = (SndBufferPtr)inRefCon;
UInt32 bufSamples = sndbuff[inBusNumber].numFrames;
AudioUnitSampleType *in = sndbuff[inBusNumber].data;
AudioUnitSampleType *outA = (AudioUnitSampleType *)ioData->mBuffers[0].mData;
AudioUnitSampleType *outB = (AudioUnitSampleType *)ioData->mBuffers[1].mData;
UInt32 sample = sndbuff[inBusNumber].sampleNum;
for (UInt32 i = 0; i < inNumberFrames; ++i) {
if (1 == inBusNumber) {
outA[i] = 0;
outB[i] = in[sample++]; -IT SAYS BAD ACCESS HERE
} else {
outA[i] = in[sample++]; -IT SAYS BAD ACCESS HERE
outB[i] = 0;
}
}
sndbuff[inBusNumber].sampleNum = sample;
return noErr;
}
_______________________________________________
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