/** * Play a sound * Implementation of the play method in AudioPlayer.java */ JNIEXPORT bool JNICALL Java_com_prettysimple_audio_AudioPlayer_play(JNIEnv *env, jobject thiz) { bool ret = false; AudioEngine *engine = AudioEngine::getInstance(); const int audioId = getAudioId(env, thiz); // try to recover the audioIde from the AudioPlayer.java object if (audioId > 0) { ret = engine->play(audioId); } return ret; }