커뮤니티 Q&A

Audiokinetic의 커뮤니티 Q&A 포럼에 오신 것을 환영합니다. 이 포럼은 Wwise와 Strata 사용자들이 서로 도움을 주는 곳입니다. Audiokinetic의 직접적인 도움을 얻으려면 지원 티켓 페이지를 사용하세요. 버그를 보고하려면 Audiokinetic 런처에서 Bug Report 옵션을 사용하세요. (Q&A 포럼에 제출된 버그 보고는 거절됩니다. 전용 Bug Report 시스템을 사용하면 보고 내용이 담당자에게 정확히 전달되어 문제 해결 가능성이 크게 높아집니다.)<segment 6493>

빠르고 정확한 답변을 얻으려면 질문을 올릴 때 다음 팁을 참고하세요.

  • 구체적인 내용을 적어주세요: 무엇을 하려는지, 혹은 어떤 특정 문제에 부딪혔는지 설명하세요.
  • 핵심 정보를 포함하세요: Wwise와 게임 엔진 버전, 운영체제 등 관련 정보를 함께 제공하세요.
  • 시도한 방법들을 알려주세요: 문제 해결을 위해 이미 어떤 단계를 시도해봤는지 설명해주세요.
  • 객관적인 사실에 초점을 맞추세요: 문제의 기술적 사실을 중심으로 설명하세요. 문제에 집중할수록 다른 사람들이 더 빠르게 해결책을 찾을 수 있습니다.

+1 투표
Is there a node in UE4 or that is added in through wwise that checks if something has ended? For example sound A has ended play sound B

 

-Rob
General Discussion Robert M. (4.6k 포인트) 로 부터

1 답변

0 투표
That would require us to implement latent actions in Blueprints. This is on our roadmap, but I can't provide a time estimate yet.
Benoit S. (Audiokinetic) (16.0k 포인트) 로 부터
For now I would be happy with a C++ callback or a multicast delegate of some kind. Would this be possible in the near future?
It's already possible in the SoundEngine, with the method:
AkPlayingID FAkAudioDevice::PostEvent(
    UAkAudioEvent * in_pEvent,
    AActor * in_pActor,
    AkUInt32 in_uFlags /*= 0*/,
    AkCallbackFunc in_pfnCallback /*= NULL*/,
    void * in_pCookie /*= NULL*/,
    bool in_bStopWhenOwnerDestroyed /*= false*/
    )

For your callback function to be called, simply set the in_uFlags to AK_EndOfEvent, and supply your own callback function in the in_pfnCallback parameter. Details can be found in the SDK file include/AK/SoundEngine/Common/AkCallback.h
Right. Thats what I was trying to avoid though. IMO it should be supported as part of UAKComponent. Is that something we could get as part of the next integration? If not I can add this myself as you suggested.
Adding a multicast delegate to the AkComponent would make this easier to use. I will add the request to our backlog.

Thanks for the suggestion!
I implemented it on my side, but for some reason, 1 time out of 100 there will be a memory leak and the delegate cause our game to crash. I'm attempting to resolve this but the stack goes back into Wwise code that is not accessible... Anyone had that problem?

Otherwise it works fine, we use this solution for two weeks before figuring out that our "rare random crash" was caused by that...
I have similar issue. This is how I fixed:

Try this:

- stop all sounds before closing the level, or stop the sounds which have a callback, prior to unloading the level to load the next level.

OR -

- put the AKCallBackFunc in a global Unreal level that doesn't unload when the next Unreal level.
Hi Benoit S.

I declare a callback function:
static void EndOfEventCallbackFunc(AkCallbackType in_eType, AkCallbackFunc* in_pCallbackInfo);

and pass it when calling the function declared in AkComponet:

PlayingID = pAkComp->PostAkEventByNameWithCallback((in_pAkEvent)->GetName(), AK_EndOfEvent, &EndOfEventCallbackFunc);

However, it fails to compile and gets the error message:

error C2664: 'AkPlayingID UAkComponent::PostAkEventByNameWithCallback(const FString &,AkUInt32,AkCallbackFunc,void *,const TArray<FAkExternalSourceInfo,FDefaultAllocator> &)': cannot convert argument 3 from 'void (__cdecl *)(AkCallbackType,AkCallbackFunc *)' to 'AkCallbackFunc'

note: This conversion requires a reinterpret_cast, a C-style cast or function-style cast

I googled and got nothing. Have you ever met this problem? Any ideas?  I am very appreciative of your assistance.
...