From b2febbe68a9a14fd5f52796f92a3f7476155b37d Mon Sep 17 00:00:00 2001 From: David Chavez Date: Thu, 9 Mar 2023 10:37:01 +0100 Subject: [PATCH] Update to use Helix for audio --- helix | 2 +- soh/CMakeLists.txt | 3 +++ soh/soh/OTRGlobals.cpp | 9 +++++---- 3 files changed, 9 insertions(+), 5 deletions(-) diff --git a/helix b/helix index bc2b6aa3669..1f5eb06de46 160000 --- a/helix +++ b/helix @@ -1 +1 @@ -Subproject commit bc2b6aa3669f46efb23330d7b37978443f5dec4e +Subproject commit 1f5eb06de46bd255081bc5983a0609f412faf88c diff --git a/soh/CMakeLists.txt b/soh/CMakeLists.txt index 6a69e19b7d8..af8f865fd33 100644 --- a/soh/CMakeLists.txt +++ b/soh/CMakeLists.txt @@ -679,6 +679,9 @@ else() "$<$:SDL2_net::SDL2_net>" ${CMAKE_DL_LIBS} Threads::Threads + "$<$:-framework CoreFoundation>" + "$<$:-framework AudioToolbox>" + "$<$:-framework CoreAudio>" ) endif() diff --git a/soh/soh/OTRGlobals.cpp b/soh/soh/OTRGlobals.cpp index 5bc0d43139d..da6ba7fa9c4 100644 --- a/soh/soh/OTRGlobals.cpp +++ b/soh/soh/OTRGlobals.cpp @@ -410,6 +410,7 @@ extern "C" void OTRAudio_Exit() { // Wait until the audio thread quit audio.thread.join(); + HLXAudioPlayerDeinit(); } extern "C" void VanillaItemTable_Init() { @@ -1359,19 +1360,19 @@ extern "C" int16_t OTRGetRectDimensionFromRightEdge(float v) { } extern "C" bool AudioPlayer_Init(void) { - return AudioPlayerInit(); + return HLXAudioPlayerInit(44100, 2); } extern "C" int AudioPlayer_Buffered(void) { - return AudioPlayerBuffered(); + return HLXAudioPlayerGetBuffered(); } extern "C" int AudioPlayer_GetDesiredBuffered(void) { - return AudioPlayerGetDesiredBuffered(); + return HLXAudioPlayerGetDesiredBuffered(); } extern "C" void AudioPlayer_Play(const uint8_t* buf, uint32_t len) { - AudioPlayerPlayFrame(buf, len); + HLXAudioPlayerPlayBuffer(buf, len); } extern "C" int Controller_ShouldRumble(size_t slot) {