Post

Replies

Boosts

Views

Activity

Reply to [iOS17] AVPlayer+AudioTapProcessor fails on Apple Clock's alarm notification
I'm experiencing a similar problem, but with a different situation. Everything used to work perfectly fine from iOS 9.0 up until iOS 17. In my case, I'm using two AVPlayer instances to create a crossfade effect. To achieve this, I use an audio mix and the "setVolumeRampFromStartVolume:toEndVolume:timeRange:" method to create a fade-out for the current track and a fade-in effect for the next track. Now, when there are 5 seconds left until the current track ends, I start the next AVPlayer, and during the crossfade transition, both players play simultaneously. This setup worked flawlessly on iOS 17.0, 17.1, iOS 17.2. However, things take a turn when you add MTAudioProcessingTapCallbacks to the audio mix (to implement 10-band equalizer in my case). After assigning the audioTapProcessor to the audio mix of both the current and next player items and attempt to start the next player before the current player has finished (to create the crossfade effect), you'll start hearing a sound crackling issue. In the Xcode console, you'll likely see the "rt_receiver::receive_loop failed: 89" error. You can reproduce this issue after playing 2-3 tracks. If you're using AVQueuePlayer in combination with MTAudioProcessingTapCallbacks, everything goes smoothly on iOS 17. However, if you opt for two separate AVPlayers, both with an audio mix that has MTAudioProcessingTapCallbacks, you'll consistently run into this issue across iOS 17.0, 17.1, and 17.2.
Nov ’23