// AUTOGENERATED FILE - DO NOT MODIFY!
// This file was generated by Djinni from tts_backend.djinni

#include "java/jni/AudioCallback.hpp"  // my header
#include "java/support/jni/DataView_jni.hpp"
#include "java/support/jni/Marshal.hpp"

namespace prism::jni {

AudioCallback::AudioCallback() : ::djinni::JniInterface<::prism::java::AudioCallback, AudioCallback>("com/github/ethindp/prism/AudioCallback$CppProxy") {}

AudioCallback::~AudioCallback() = default;


static void JNICALL Java_com_github_ethindp_prism_AudioCallback_00024CppProxy_nativeDestroy(JNIEnv* jniEnv, jobject /*this*/, jlong nativeRef)
{
    try {
        delete reinterpret_cast<::djinni::CppProxyHandle<::prism::java::AudioCallback>*>(nativeRef);
    } JNI_TRANSLATE_EXCEPTIONS_RETURN(jniEnv, )
}

static void JNICALL Java_com_github_ethindp_prism_AudioCallback_00024CppProxy_native_1onAudio(JNIEnv* jniEnv, jobject /*this*/, jlong nativeRef, jlong j_userdata, ::djinni::NativeDataView::JniType j_samples, jlong j_sampleCount, jlong j_channels, jlong j_sampleRate)
{
    try {
        const auto& ref = ::djinni::objectFromHandleAddress<::prism::java::AudioCallback>(nativeRef);
        ref->on_audio(::djinni::I64::toCpp(jniEnv, j_userdata),
                      ::djinni::NativeDataView::toCpp(jniEnv, j_samples),
                      ::djinni::I64::toCpp(jniEnv, j_sampleCount),
                      ::djinni::I64::toCpp(jniEnv, j_channels),
                      ::djinni::I64::toCpp(jniEnv, j_sampleRate));
    } JNI_TRANSLATE_EXCEPTIONS_RETURN(jniEnv, )
}
const JNINativeMethod AudioCallbackProxyRecords[] = 
{
    {
        const_cast<char*>("nativeDestroy"), const_cast<char*>("(J)V"), reinterpret_cast<void*>(Java_com_github_ethindp_prism_AudioCallback_00024CppProxy_nativeDestroy),
    },
    {
        const_cast<char*>("native_onAudio"), const_cast<char*>("(JJLjava/nio/ByteBuffer;JJJ)V"), reinterpret_cast<void*>(Java_com_github_ethindp_prism_AudioCallback_00024CppProxy_native_1onAudio),
    },
};

} // namespace prism::jni
