Commit 6c7f6cd3 authored by David Reid's avatar David Reid

Core Audio: Try fixing a compilation error when targeting tvOS and watchOS.

Public issue #108
parent c03c12dc
...@@ -17938,6 +17938,12 @@ Core Audio Backend ...@@ -17938,6 +17938,12 @@ Core Audio Backend
#if defined(TARGET_OS_IPHONE) && TARGET_OS_IPHONE == 1 #if defined(TARGET_OS_IPHONE) && TARGET_OS_IPHONE == 1
#define MA_APPLE_MOBILE #define MA_APPLE_MOBILE
#if defined(TARGET_OS_TV) && TARGET_OS_TV == 1
#define MA_APPLE_TV
#endif
#if defined(TARGET_OS_WATCH) && TARGET_OS_WATCH == 1
#define MA_APPLE_WATCH
#endif
#else #else
#define MA_APPLE_DESKTOP #define MA_APPLE_DESKTOP
#endif #endif
...@@ -20595,11 +20601,14 @@ ma_result ma_context_init__coreaudio(const ma_context_config* pConfig, ma_contex ...@@ -20595,11 +20601,14 @@ ma_result ma_context_init__coreaudio(const ma_context_config* pConfig, ma_contex
[pAudioSession setCategory: AVAudioSessionCategoryPlayAndRecord withOptions:options error:nil]; [pAudioSession setCategory: AVAudioSessionCategoryPlayAndRecord withOptions:options error:nil];
/* AVAudioSessionPortOverrideSpeaker is not available on Apple TV OS nor Apple Watch OS. */
#if !defined(MA_APPLE_TV) && !defined(MA_APPLE_WATCH)
/* By default we want miniaudio to use the speakers instead of the receiver. In the future this may be customizable. */ /* By default we want miniaudio to use the speakers instead of the receiver. In the future this may be customizable. */
ma_bool32 useSpeakers = MA_TRUE; ma_bool32 useSpeakers = MA_TRUE;
if (useSpeakers) { if (useSpeakers) {
[pAudioSession overrideOutputAudioPort:AVAudioSessionPortOverrideSpeaker error:nil]; [pAudioSession overrideOutputAudioPort:AVAudioSessionPortOverrideSpeaker error:nil];
} }
#endif
} }
#endif #endif
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment