Newer
Older
music / app / src / main / cpp / AndroidBridge.cpp
@lukas lukas on 28 Jul 2022 581 bytes play a tone
  1. #include <jni.h>
  2. #include <android/input.h>
  3. #include "AudioEngine.h"
  4. #include <jni.h>
  5. #include <string>
  6.  
  7. static AudioEngine *audioEngine;
  8.  
  9. extern "C" {
  10.  
  11. JNIEXPORT void JNICALL
  12. Java_com_lukas_music_MainActivity_startAudio(JNIEnv *env, jobject activity) {
  13. audioEngine = new AudioEngine();
  14. }
  15.  
  16. JNIEXPORT void JNICALL
  17. Java_com_lukas_music_MainActivity_muteAudio(JNIEnv *env, jobject activity, float volume) {
  18. audioEngine->stop();
  19. }
  20.  
  21. JNIEXPORT void JNICALL
  22. Java_com_lukas_music_MainActivity_unmuteAudio(JNIEnv *env, jobject activity, float volume) {
  23. audioEngine->start();
  24. }
  25. }