AVCaptureDeviceInput and AVCaptureAudioDataOutput with different Channels in Stream Description

I am creating AVCaptureDeviceInput using an audio driver (user land driver) which has 6 channels (5.1 channels). The audio driver captures system's audio.

I am creating AVCaptureAudioDataOutput using stream description of 2 channels.

Now I add AVCaptureDeviceInput and AVCaptureAudioDataOutput to AVCaptureSession and write sample buffers of AVCaptureAudioDataOutput to a file.

I play a 5.1 file in my system and my above sample app writes it to a file.

  • The recorded audio will have 2 channels as per steam description.
  • the recorded file will have all 5.1 channels recorded in a stereo file (Eg: Left Front and Rear in Left; Right Front & Rear in Right).

My query is: Who handles the mixing here?

Thank you.

To summarise: Recorded file will have stereo channels, Left front and rear is recorded in Left channel; Right Front and rear is recorded in right channel. I am not handling mixing explicitly. I wanted to know if AVCaptureAudioDataOutput mixes channels if it receives 6 channels as input and output should be only 2.

AVCaptureDeviceInput and AVCaptureAudioDataOutput with different Channels in Stream Description
 
 
Q