menu
 

Audiokinetic의 커뮤니티 Q&A는 사용자가 Wwise와 Strata 커뮤니티 내에서 서로 질문과 답변을 하는 포럼입니다. Audiokinetic의 기술 지원팀에게 문의하고 싶으신 경우 지원 티켓 페이지를 사용해주세요.

0 투표

Hello,

We're currently in the process of trying to upgrade from 2016.1.1 to the latest 2019.1.1 release, but are running into a failure when attempting to initialize the sound engine. This is with a mixed Java/C++ game, not a native NDK activity based app. 

The following code is used for sound engine initialization, the Java VM is obtained from the initial JNI_OnLoad(JavaVM * vm, void *reserved) call which happens when our library is loaded. This works fine in 2016.1.1 but fails under 2019.1.1 for some reason. I'm unable to debug this further as I lack the source code to the SoundEngine. 

 AkInitSettings initSettings;
 AkPlatformInitSettings platformInitSettings;
 AK::SoundEngine::GetDefaultInitSettings( initSettings );
 AK::SoundEngine::GetDefaultPlatformInitSettings( platformInitSettings );
 platformInitSettings.pJavaVM = OurCustomLib->GetJavaVM();
 if ( AK::SoundEngine::Init( &initSettings, &platformInitSettings ) != AK_Success ) -> Failure: AKDEBUG: Java VM not initialized or not provided in AkInitSettings.

Please advise.

Thanks

General Discussion Gregg W. (100 포인트) 로 부터

1 답변

0 투표

你好,大神,我也遇到这个问题

AkPlatformInitSettings platformInitSettings;
JavaVM* jvm = cocos2d::JniHelper::getJavaVM();
platformInitSettings.pJavaVM = jvm;


JNIEnv* env = cocos2d::JniHelper::getEnv();
jclass classID=env->FindClass("org/cocos2dx/javascript/AppActivity");
jmethodID methodID = env->GetStaticMethodID(classID, "getInstance", "()Ljava/lang/Object;");
platformInitSettings.jActivity = env->CallStaticObjectMethod(classID, methodID);

AKRESULT res0 = m_pLowLevelIO->Init(platformInitSettings.pJavaVM,platformInitSettings.jActivity);

 

AKRESULT res1 = AK::SoundEngine::Init(&initSettings, &platformInitSettings);//Java VM not initialized or not provided in AkInitSettings.
afd d. (310 포인트) 로 부터
...