需要不弃用的替代品(顺便说一句,我认为这仍然在当前的苹果文档中,地址为 link):
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
}
关于ios - AudioSessionSetProperty 在 iOS 7.0 中被弃用,那么如何设置 kAudioSessionProperty_OverrideCategoryMixWithOthers,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/21682502/