Audiokinetic's Community Q&A is the forum where users can ask and answer questions within the Wwise and Strata communities. If you would like to get an answer from Audiokinetic's Technical support team, make sure you use the Support Tickets page.

【UE4】AkComponent do not callback whatever use mask 0 or 1

0 votes
When I use the offical export function to post event, Callback worked. But, if I directly NewObject<UAkComponent> and  call AkComponent->PostAkEventByNameWithDelegate(EventName, AkCallbackType::AK_EndOfEvent, OnEventCallBack). callback function will not be called and the uUserFlags always be 0 nomatter what the mask I used.

code like :

                UAkComponent* AkComponent = NewObject<UAkComponent>();
                if (AkComponent)
                {
                    FString EventName = EventID.ToString();
                    FAkAudioDevice* AudioDevice = FAkAudioDevice::Get();
                    if (AudioDevice) {
                        AkComponent->RegisterComponentWithWorld(UGameInstance::Get()->GetWorld());
                        AkComponent->SetWorldLocationAndRotation((Position), FRotator::FRotator().Quaternion());
                        AkComponent->SetAutoDestroy(false);
                        AkComponent->OcclusionRefreshInterval = 0;
                        {
                            FOnAkPostEventCallback OnEventCallBack;
                            OnEventCallBack.BindDynamic(this, &UAuidoInstanceMgr::OnPostEventCallback);
                            //AkPlayingId = AudioDevice->PostEvent(EventName, AkComponent, OnEventCallBack, AkCallbackType::AK_EndOfEvent);
                            AkPlayingId = AkComponent->PostAkEventByNameWithDelegate(EventName, AkCallbackType::AK_EndOfEvent, OnEventCallBack);

                        }
                    }
                }

and. at the wise code:

FAkComponentCallbackManager::AkComponentCallback  

the pPackage->uUserFlags always be 0.

 

-/-
asked Oct 26, 2021 in General Discussion by iCooobe K. (100 points)

Please sign-in or register to answer this question.

...