From dc8c93ff1d3a8b346ab6471ca11eb09597247e5a Mon Sep 17 00:00:00 2001 From: David Reid Date: Tue, 20 Nov 2018 18:42:40 +1000 Subject: [PATCH] iOS: Output sound to speakers instead of receiver by default. --- mini_al.h | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/mini_al.h b/mini_al.h index bb999c6b..117e068b 100644 --- a/mini_al.h +++ b/mini_al.h @@ -15678,6 +15678,13 @@ mal_result mal_context_init__coreaudio(mal_context* pContext) mal_assert(pAudioSession != NULL); [pAudioSession setCategory: AVAudioSessionCategoryPlayAndRecord error:nil]; + + // By default we want mini_al to use the speakers instead of the receiver. In the future this may + // be customizable. + mal_bool32 useSpeakers = MAL_TRUE; + if (useSpeakers) { + [pAudioSession overrideOutputAudioPort:AVAudioSessionPortOverrideSpeaker error:nil]; + } } #endif