diff --git a/modules/juce_audio_devices/native/juce_Audio_ios.cpp b/modules/juce_audio_devices/native/juce_Audio_ios.cpp index 2350f1bb63..d8c6d9e0be 100644 --- a/modules/juce_audio_devices/native/juce_Audio_ios.cpp +++ b/modules/juce_audio_devices/native/juce_Audio_ios.cpp @@ -371,10 +371,16 @@ struct iOSAudioIODevice::Pimpl final : public AsyncUpdater if (category == AVAudioSessionCategoryPlayAndRecord) { + #if JUCE_IOS_API_VERSION_CAN_BE_BUILT (26, 0) + constexpr auto bluetoothOption = AVAudioSessionCategoryOptionAllowBluetoothHFP; + #else + constexpr auto bluetoothOption = AVAudioSessionCategoryOptionAllowBluetooth; + #endif + options |= AVAudioSessionCategoryOptionDefaultToSpeaker - | AVAudioSessionCategoryOptionAllowBluetooth | AVAudioSessionCategoryOptionAllowAirPlay - | AVAudioSessionCategoryOptionAllowBluetoothA2DP; + | AVAudioSessionCategoryOptionAllowBluetoothA2DP + | bluetoothOption; } JUCE_NSERROR_CHECK ([[AVAudioSession sharedInstance] setCategory: category