mirror of
https://github.com/mackron/miniaudio.git
synced 2026-04-23 00:34:03 +02:00
Core Audio: Try fixing a compilation error when targeting tvOS and watchOS.
Public issue #108
This commit is contained in:
@@ -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
|
|||||||
|
|
||||||
[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
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user