1
0
Fork 0
mirror of https://github.com/juce-framework/JUCE.git synced 2026-01-09 23:34:20 +00:00

iOS: Fix deprecation warning

This commit is contained in:
reuk 2025-06-10 13:16:47 +01:00
parent 6f1d116279
commit 37bb7a6c30
No known key found for this signature in database

View file

@ -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