mirror of
https://github.com/love2d/love.git
synced 2026-08-12 00:20:52 +02:00
Merge pull request #2350 from Levils114/refactor/ios/allow-sound-even-iphone-unmuted
refactor: allow sound even iphone is unmuted
This commit is contained in:
+9
-4
@@ -376,13 +376,18 @@ bool setAudioMixWithOthers(bool mixEnabled)
|
||||
{
|
||||
@autoreleasepool
|
||||
{
|
||||
NSString *category = AVAudioSessionCategorySoloAmbient;
|
||||
NSError *err;
|
||||
AVAudioSession *session = [AVAudioSession sharedInstance];
|
||||
NSString *category = AVAudioSessionCategoryPlayback;
|
||||
NSUInteger options = 0;
|
||||
NSError *err = nil;
|
||||
|
||||
if (mixEnabled)
|
||||
category = AVAudioSessionCategoryAmbient;
|
||||
options = AVAudioSessionCategoryOptionMixWithOthers;
|
||||
|
||||
bool success = [[AVAudioSession sharedInstance] setCategory:category error:&err];
|
||||
bool success = [session setCategory:category
|
||||
mode:AVAudioSessionModeDefault
|
||||
options:options
|
||||
error:&err];
|
||||
if (!success)
|
||||
NSLog(@"Error in AVAudioSession setCategory: %@", [err localizedDescription]);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user