AudioUnitRender got error kAudioUnitErr_CannotDoInCurrentContext (-10863)
问题 I want to play the recorded audio directly to speaker when headset is plugged in an iOS device. What I did is calling AudioUnitRender in AURenderCallback func so that the audio data is writed to AudioBuffer structure. It works well if the "IO buffer duration" is not set or set to 0.020seconds. If the "IO buffer duration" is set to a small value (0.005 etc.) by calling setPreferredIOBufferDuration , AudioUnitRender() will return an error: kAudioUnitErr_CannotDoInCurrentContext (-10863). Any