AudioSessionSetProperty在iOS 7.0中弃用,所以如何设置kAudioSessionProperty_OverrideCategoryMixWithOthers

需要不弃用的替代(顺便说一句,我认为这仍然是在当前的苹果文档链接 ):

OSStatus propertySetError = 0; UInt32 allowMixing = true; propertySetError = AudioSessionSetProperty ( kAudioSessionProperty_OverrideCategoryMixWithOthers, // 1 sizeof (allowMixing), // 2 &allowMixing // 3 ); 

谢谢;

使用AVAudioSession

 AVAudioSession *session = [AVAudioSession sharedInstance]; NSError *setCategoryError = nil; if (![session setCategory:AVAudioSessionCategoryPlayback withOptions:AVAudioSessionCategoryOptionMixWithOthers error:&setCategoryError]) { // handle error }