The code related to t.audio.mixwithsystem=true is run before the audio module is loaded. Fixes issue #1430.

This commit is contained in:
Alex Szpakowski
2018-12-26 11:36:23 -04:00
parent f504ace6cd
commit 324a290040
8 changed files with 43 additions and 17 deletions
+5 -2
View File
@@ -347,7 +347,7 @@ void vibrate()
}
}
void setAudioMixWithOthers(bool mixEnabled)
bool setAudioMixWithOthers(bool mixEnabled)
{
@autoreleasepool
{
@@ -357,8 +357,11 @@ void setAudioMixWithOthers(bool mixEnabled)
if (mixEnabled)
category = AVAudioSessionCategoryAmbient;
if (![[AVAudioSession sharedInstance] setCategory:category error:&err])
bool success = [[AVAudioSession sharedInstance] setCategory:category error:&err];
if (!success)
NSLog(@"Error in AVAudioSession setCategory: %@", [err localizedDescription]);
return success;
}
}