From 351ac32d74cd76f0006713cafe34e773f1686946 Mon Sep 17 00:00:00 2001 From: David Reid Date: Tue, 13 Nov 2018 13:44:22 +1000 Subject: [PATCH] Try fixing a bug on iOS. --- mini_al.h | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/mini_al.h b/mini_al.h index 9a1fc293..ffa2a130 100644 --- a/mini_al.h +++ b/mini_al.h @@ -15567,6 +15567,15 @@ mal_result mal_context_uninit__coreaudio(mal_context* pContext) mal_result mal_context_init__coreaudio(mal_context* pContext) { mal_assert(pContext != NULL); + +#if defined(MAL_APPLE_MOBILE) + @autoreleasepool { + AVAudioSession* pAudioSession = [AVAudioSession sharedInstance]; + mal_assert(pAudioSession != NULL); + + [pAudioSession setCategory: AVAudioSessionCategoryPlayAndRecord error:nil]; + } +#endif #if !defined(MAL_NO_RUNTIME_LINKING) && !defined(MAL_APPLE_MOBILE) pContext->coreaudio.hCoreFoundation = mal_dlopen("CoreFoundation.framework/CoreFoundation");