diff --git a/.rive_head b/.rive_head index 35589d3d..e0371664 100644 --- a/.rive_head +++ b/.rive_head @@ -1 +1 @@ -4a9947630d3848ff70813cf5e2d8718adb9a1b90 +ca916e974e58c76923bc569ef76d409d82453f68 diff --git a/kotlin/src/main/cpp/CMakeLists.txt b/kotlin/src/main/cpp/CMakeLists.txt index 2c1a9021..034b50f6 100644 --- a/kotlin/src/main/cpp/CMakeLists.txt +++ b/kotlin/src/main/cpp/CMakeLists.txt @@ -34,6 +34,8 @@ message("BUILD TYPE: ${CMAKE_BUILD_TYPE}") add_definitions(-DSK_GL) add_definitions(-DRIVE_GLES) +# Provide this manually so Android Studio plays nicely with C++. +add_definitions(-DWITH_RIVE_AUDIO) if (CMAKE_BUILD_TYPE STREQUAL "Debug") set(SKIA_DIR_NAME "skia_debug") diff --git a/kotlin/src/main/cpp/src/models/worker_impl.cpp b/kotlin/src/main/cpp/src/models/worker_impl.cpp index 05055d06..f2e876ee 100644 --- a/kotlin/src/main/cpp/src/models/worker_impl.cpp +++ b/kotlin/src/main/cpp/src/models/worker_impl.cpp @@ -1,6 +1,7 @@ #include "models/worker_impl.hpp" #include "rive/pls/gl/pls_render_target_gl.hpp" +#include "rive/audio/audio_engine.hpp" namespace rive_android { @@ -52,10 +53,12 @@ void WorkerImpl::start(jobject ktRenderer, std::chrono::high_resolution_clock::t m_ktAdvanceCallback = env->GetMethodID(m_ktRendererClass, "advance", "(F)V"); m_lastFrameTime = frameTime; m_isStarted = true; + rive::AudioEngine::RuntimeEngine()->start(); } void WorkerImpl::stop() { + rive::AudioEngine::RuntimeEngine()->stop(); auto env = GetJNIEnv(); if (m_ktRendererClass != nullptr) {