Skip to content

Commit

Permalink
Allow Bluetooth headphones for iOS playandrecord mode
Browse files Browse the repository at this point in the history
  • Loading branch information
slouken committed Apr 14, 2020
1 parent 2d1f7be commit 2ae1c0f
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 0 deletions.
Empty file modified Xcode-iOS/Test/TestiPhoneOS.xcodeproj/project.pbxproj 100644 → 100755
Empty file.
8 changes: 8 additions & 0 deletions src/audio/coreaudio/SDL_coreaudio.m
Expand Up @@ -370,7 +370,15 @@ static BOOL update_audio_session(_THIS, SDL_bool open, SDL_bool allow_playandrec
if (category == AVAudioSessionCategoryPlayAndRecord) {
options |= AVAudioSessionCategoryOptionDefaultToSpeaker;
}
if (category == AVAudioSessionCategoryRecord ||
category == AVAudioSessionCategoryPlayAndRecord) {
options |= AVAudioSessionCategoryOptionAllowBluetooth;
}
#endif
if (category == AVAudioSessionCategoryPlayAndRecord) {
options |= AVAudioSessionCategoryOptionAllowBluetoothA2DP |
AVAudioSessionCategoryOptionAllowAirPlay;
}

if ([session respondsToSelector:@selector(setCategory:mode:options:error:)]) {
if (![session.category isEqualToString:category] || session.categoryOptions != options) {
Expand Down

0 comments on commit 2ae1c0f

Please sign in to comment.