文件名称:AVAudioSession
文件大小:597B
文件格式:
更新时间:2017-12-02 11:02:01
Audio
- (void)applicationDidBecomeActive:(UIApplication *)application { if ([[AVAudioSession sharedInstance] isOtherAudioPlaying]) { [[AVAudioSession sharedInstance] setCategory:AVAudioSessionCategorySoloAmbient error:nil]; [[AVAudioSession sharedInstance] setActive:YES error:nil]; } else { [[AVAudioSession sharedInstance] setCategory:AVAudioSessionCategoryPlayback withOptions:AVAudioSessionCategoryOptionMixWithOthers error:nil]; [[AVAudioSession sharedInstance] setActive:YES error:nil]; } }