Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

AudioSessionSetProperty deprecated in iOS 7.0 so how set kAudioSessionProperty_OverrideCategoryMixWithOthers

Tags:

Need non deprecated alternate to (btw I think this is still in the current apple docs at link):

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

Thanks;

like image 738
Carm100 Avatar asked Feb 10 '14 16:02

Carm100


1 Answers

Use AVAudioSession:

AVAudioSession *session = [AVAudioSession sharedInstance];  NSError *setCategoryError = nil; if (![session setCategory:AVAudioSessionCategoryPlayback          withOptions:AVAudioSessionCategoryOptionMixWithOthers          error:&setCategoryError]) {     // handle error } 
like image 142
Tom Harrington Avatar answered Oct 16 '22 12:10

Tom Harrington