Why get Error kAudioUnitErr_CannotDoInCurrentContext when call AudioUnitRender in InputCallback
Why get Error kAudioUnitErr_CannotDoInCurrentContext when call AudioUnitRender in InputCallback
- Subject: Why get Error kAudioUnitErr_CannotDoInCurrentContext when call AudioUnitRender in InputCallback
- From: zheng ying <email@hidden>
- Date: Thu, 16 Jul 2009 07:30:50 +0800
Hi. all
Why get Error kAudioUnitErr_CannotDoInCurrentContext when
call AudioUnitRender in InputCallback, who can give me some
Help , THANKS.
here is my parameter setting list:
fOutputFormat.mSampleRate = 8000;
fOutputFormat.mFormatID = kAudioFormatLinearPCM;
fOutputFormat.mFormatFlags =
kLinearPCMFormatFlagIsNonInterleaved|kLinearPCMFormatFlagIsSignedInteger;
fOutputFormat.mBytesPerFrame = 2;
fOutputFormat.mBytesPerPacket = 2;
fOutputFormat.mFramesPerPacket = 1;
fOutputFormat.mChannelsPerFrame = 1;
fOutputFormat.mBitsPerChannel = 16;
// Set the AudioOutputUnit output data format
err = AudioUnitSetProperty(fAudioUnit,
kAudioUnitProperty_StreamFormat, kAudioUnitScope_Output, 1,
&fOutputFormat, sizeof(AudioStreamBasicDescription));
if(err != noErr)
{
fprintf(stderr, "failed to set input device ASBD\n");
return err;
}
param = sizeof(UInt32);
fAudioSamples = 160;
err = AudioUnitSetProperty(fAudioUnit,
kAudioDevicePropertyBufferFrameSize, kAudioUnitScope_Global, 0,
&fAudioSamples, param);
...
---------
in my inputcallback we render the data to buffer , got error... code here
DCAudioFileRecorder *afr = (DCAudioFileRecorder*)inRefCon;
OSStatus err = noErr;
// Render into audio buffer
err = AudioUnitRender(afr->fAudioUnit, ioActionFlags, inTimeStamp,
inBusNumber, inNumberFrames, afr->fAudioBuffer);
//ERROR HERE kAudioUnitErr_CannotDoInCurrentContext
...
_______________________________________________
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