The header file for MTAudioProcessingTap says that its initialization and prepare callbacks will be balanced by unprepare and finalize callbacks. However, in Apple\'s exampl
I had the same problem. To make it work, I had to reset the player item's audioMix
, the tap processor (MYAudioTapProcessor
in Apple's sample project) and manually release the MTAudioProcessingTapRef
:
MTAudioProcessingTapRef tap = ((AVMutableAudioMixInputParameters *)_audioTapProcessor.audioMix.inputParameters[0]).audioTapProcessor;
_player.currentItem.audioMix = nil;
_audioTapProcessor = nil;
CFRelease(tap);
This causes the finalize
callback to be invoked.
Edit: Seems like the CFRelease
is not required, see comments.