mirror of
https://github.com/love2d/love.git
synced 2026-08-16 00:02:12 +02:00
Move setMixMode to love.audio
This commit is contained in:
+10
-12
@@ -349,25 +349,23 @@ void setAudioMixWithOthers(bool mixMode, bool playMuted)
|
||||
{
|
||||
@autoreleasepool
|
||||
{
|
||||
NSError* err;
|
||||
NSString *category = AVAudioSessionCategoryPlayback;
|
||||
AVAudioSessionCategoryOptions options = 0;
|
||||
NSError *err = nil;
|
||||
|
||||
if (mixMode)
|
||||
{
|
||||
if (playMuted)
|
||||
{
|
||||
[[AVAudioSession sharedInstance] setCategory:AVAudioSessionCategoryPlayback withOptions:AVAudioSessionCategoryOptionMixWithOthers error:&err];
|
||||
}
|
||||
options = AVAudioSessionCategoryOptionMixWithOthers;
|
||||
else
|
||||
{
|
||||
[[AVAudioSession sharedInstance] setCategory:AVAudioSessionCategoryAmbient error:&err];
|
||||
}
|
||||
category = AVAudioSessionCategoryAmbient;
|
||||
}
|
||||
else
|
||||
else if (!playMuted)
|
||||
{
|
||||
if (playMuted)
|
||||
{
|
||||
[[AVAudioSession sharedInstance] setCategory:AVAudioSessionCategoryPlayback error:&err];
|
||||
}
|
||||
category = AVAudioSessionCategorySoloAmbient;
|
||||
}
|
||||
|
||||
[[AVAudioSession sharedInstance] setCategory:category withOptions:options error:&err];
|
||||
if (err != nil)
|
||||
NSLog(@"Error in AVAudioSession setCategory: %@", [err localizedDescription]);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user