Skip to content

Commit

Permalink
Update to use Helix for audio
Browse files Browse the repository at this point in the history
  • Loading branch information
dcvz committed Mar 9, 2023
1 parent 8b56ca4 commit c64379b
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 5 deletions.
2 changes: 1 addition & 1 deletion helix
Submodule helix updated from bc2b6a to 1f5eb0
3 changes: 3 additions & 0 deletions soh/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -679,6 +679,9 @@ else()
"$<$<BOOL:${BUILD_CROWD_CONTROL}>:SDL2_net::SDL2_net>"
${CMAKE_DL_LIBS}
Threads::Threads
"$<$<PLATFORM_ID:Darwin>:-framework CoreFoundation>"
"$<$<PLATFORM_ID:Darwin>:-framework AudioToolbox>"
"$<$<PLATFORM_ID:Darwin>:-framework CoreAudio>"
)
endif()

Expand Down
9 changes: 5 additions & 4 deletions soh/soh/OTRGlobals.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -410,6 +410,7 @@ extern "C" void OTRAudio_Exit() {

// Wait until the audio thread quit
audio.thread.join();
HLXAudioPlayerDeinit();
}

extern "C" void VanillaItemTable_Init() {
Expand Down Expand Up @@ -1355,19 +1356,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) {
Expand Down

0 comments on commit c64379b

Please sign in to comment.