我正在尝试从 remoteIO 录制,这是我的回调。我有一个问题......代码永远不会进入 if (*ioActionFlags == kAudioUnitRenderAction_PostRender)
我如何真正停止录制,使其进入 kAudioUnitRenderAction_PostRender ?对 Core Audio 来说非常新,所以这可能是一个愚蠢的问题(我感觉很好;))非常感谢。
码头。
static OSStatus RecordingCallback (
void * inRefCon,
AudioUnitRenderActionFlags * ioActionFlags,
const AudioTimeStamp * inTimeStamp,
UInt32 inBusNumber,
UInt32 inNumberFrames,
AudioBufferList * ioData) {
EffectState *effectState = (EffectState*) inRefCon;
// just copy samples
UInt32 bus1 = 1;
CheckError(AudioUnitRender(effectState->rioUnit,
ioActionFlags,
inTimeStamp,
bus1,
inNumberFrames,
ioData),
"Couldn't render from RemoteIO unit");
if (*ioActionFlags == kAudioUnitRenderAction_PostRender)
{
OSStatus result = ExtAudioFileWriteAsync(effectState->outputFile,inNumberFrames,ioData);
if(result) printf("ExtAudioFileWriteAsync %ld \n", result);
}
return noErr;
}