ios AVAudioSession multi-channel video data playback sound problems

ios. If found to play mode when required multiple video streams simultaneously

AVAudioSessionCategoryPlayAndRecord

, The subsequent addition of playing video stream can not go in speaker; and, if the first player in setting this mode, found not working, and sometimes can, sometimes no effect;

Therefore, the information found in the online search, you can use the following mode

AVAudioSessionCategoryMultiRoute

Open support multiple video streams, this would be no problem;

    dispatch_async(dispatch_get_main_queue(), ^{
        [[AVAudioSession sharedInstance] setCategory:AVAudioSessionCategoryMultiRoute withOptions:AVAudioSessionCategoryOptionDefaultToSpeaker | AVAudioSessionCategoryOptionMixWithOthers | AVAudioSessionCategoryOptionAllowBluetooth error:nil];
	 [[AVAudioSession sharedInstance] setActive:YES error:nil];
    });

Published 172 original articles · won praise 35 · views 390 000 +

Guess you like

Origin blog.csdn.net/u012198553/article/details/91042954