iOS stereo capture audio level drops dramatically after AVPlayer starts playing

The stereo capture API works fine when no sound is playback from the speakers, but the recrded volume drops dramatically when AVPlayer is playing any audio file simultaneously, which means the stereo capture can only work property when the iPhone is muted.

Steps to reproduce:

  1. Run iOS stereo audio capture demo (https://developer.apple.com/documentation/avfaudio/avaudiosession/capturing_stereo_audio_from_built-in_microphones)
  2. Use AVPlayer to play out an audio file
  3. The recorded audio level is OK before the AVPlayer starts to play, but its recorded level drops dramatically once AVPlayer starts to play
iOS stereo capture audio level drops dramatically after AVPlayer starts playing
 
 
Q