[英]iOS AVAudioRecorder record without stopping background audio
我需要允许我的应用在不停止背景音乐播放器的情况下录制音频。
我正在使用AVAudioRecorder。
[[AVAudioSession sharedInstance] setCategory:AVAudioSessionCategoryPlayAndRecord error:nil];
但是,无论何时调用[audioplayer record],背景音乐都会停止播放。
我该怎么做才能使背景音乐不停止播放?
谢谢。
您还需要添加MixWithOthers类别选项:
[[AVAudioSession sharedInstance] setCategory:AVAudioSessionCategoryPlayAndRecord
withOptions:AVAudioSessionCategoryOptionMixWithOthers
error:nil];
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.