File tree Expand file tree Collapse file tree 1 file changed +5
-0
lines changed Expand file tree Collapse file tree 1 file changed +5
-0
lines changed Original file line number Diff line number Diff line change @@ -20,20 +20,25 @@ + (void)ensureAudioSessionWithRecording:(BOOL)recording {
20
20
config.categoryOptions = AVAudioSessionCategoryOptionDefaultToSpeaker |
21
21
AVAudioSessionCategoryOptionAllowBluetooth |
22
22
AVAudioSessionCategoryOptionAllowBluetoothA2DP;
23
+
24
+ [session lockForConfiguration ];
23
25
[session setCategory: config.category
24
26
withOptions: config.categoryOptions
25
27
error: nil ];
26
28
[session setMode: config.mode error: nil ];
29
+ [session unlockForConfiguration ];
27
30
} else if (!recording && (session.category == AVAudioSessionCategoryAmbient
28
31
|| session.category == AVAudioSessionCategorySoloAmbient)) {
29
32
config.category = AVAudioSessionCategoryPlayback;
30
33
config.categoryOptions = 0 ;
31
34
32
35
// upgrade from ambient if needed
36
+ [session lockForConfiguration ];
33
37
[session setCategory: config.category
34
38
withOptions: config.categoryOptions
35
39
error: nil ];
36
40
[session setMode: config.mode error: nil ];
41
+ [session unlockForConfiguration ];
37
42
}
38
43
#endif
39
44
}
You can’t perform that action at this time.
0 commit comments