iOS AVAudioRecorder在不停止背景音频的情况下录制
我需要允许我的应用程序在不停止背景音乐播放器的情况下录制音频 我用的是AVAudioRecorderiOS AVAudioRecorder在不停止背景音频的情况下录制,ios,avfoundation,Ios,Avfoundation,我需要允许我的应用程序在不停止背景音乐播放器的情况下录制音频 我用的是AVAudioRecorder [[AVAudioSession sharedInstance] setCategory:AVAudioSessionCategoryPlayAndRecord error:nil]; 但是,只要调用[audioplayer record],背景音乐就会停止播放 我能做些什么使背景音乐不会停止播放 谢谢。您还需要添加MixWithOthers类别选项: [[AVAudioSession sha
[[AVAudioSession sharedInstance] setCategory:AVAudioSessionCategoryPlayAndRecord error:nil];
但是,只要调用[audioplayer record],背景音乐就会停止播放
我能做些什么使背景音乐不会停止播放
谢谢。您还需要添加MixWithOthers类别选项:
[[AVAudioSession sharedInstance] setCategory:AVAudioSessionCategoryPlayAndRecord
withOptions:AVAudioSessionCategoryOptionMixWithOthers
error:nil];