开发者_高级运维What is the correct way to implement a callback on the RemoteIO after the aumixer has done it's thang.
If i use ;
result = AUGraphSetNodeInputCallback(mGraph, outputNode,1, &remoteIOCallback);
It doesn't call my function
If I use ..
result = AudioUnitSetProperty(mIONode, kAudioOutputUnitProperty_SetInputCallback, kAudioUnitScope_Input, 1 , &remoteIOCallback, sizeof(remoteIOCallback));
It calls my callback but when i try to create a pointer to the ioData
AudioSampleType *inData = (AudioSampleType *) ioData->mBuffers[0].mData;
it crashes.
I cannot see the problem at all. Is this a problem with the buffers? But then i'm not allocating anything to the buffer, just a pointer to it.
Cheers
Instead of immediately casting to an AudioSampleType*, first try casting ioData to your custom data type. Then try accessing the data in the buffer.
精彩评论