AVAssetReader and Audio Queue streaming problem

后端 未结 3 1942
北海茫月
北海茫月 2021-01-07 03:14

I have a problem with the AVAssetReader here to get samples from the iPod library and stream it via Audio Queue. I have not been able to find any such example so I try to im

3条回答
  •  星月不相逢
    2021-01-07 03:48

    From the Audio Session Programming Guide, under AVAudioSessionCategoryAmbient:

    This category allows audio from the iPod, Safari, and other built-in applications to play while your application is playing audio.

    Using an AVAssetReader probably uses iOS' hardware decoder, which blocks the use of the AudioQueue. Setting AVAudioSessionCategoryAmbient means the audio is rendered in software, allowing both to work at the same time - however, this would have an impact on performance/battery life. (See Audio Session Programming Guide under "How Categories Affect Encoding and Decoding").

提交回复
热议问题