Problems with 5.6 Audio

#1
Hello.
In 5.5 version, I could execute a trigger smth like this

Code: Select all

CryAudio::ControlId nTriggerID = CryAudio::StringToId("Play_SoftHit");
if (nTriggerID != 0)
{
CryAudio::SRequestUserData const userData(CryAudio::ERequestFlags::DoneCallbackOnExternalThread | CryAudio::ERequestFlags::CallbackOnExternalOrCallingThread, this);
m_pIEntityAudioComponent->ExecuteTrigger(nTriggerID, m_audioProxyID, userData);
}
But, in 5.6, no matter what I tried, I can't execute a trigger from code on some entity.
Can someone, please, tell, what have changed and what is a new correct way of doing this?

Re: Problems with 5.6 Audio

#3
Hello,
Just a heads up, we renamed the callback types that you're using in your example code for 5.6 from DoneCallbackOnExternalThread to SubsequentCallbackOnExternalThread and DoneCallbackOnAudioThread to SubsequentCallbackOnAudioThread. So you should actually get a compile error with that code on 5.6.

Also, I recommend to use proper types when checking values. For example instead of using 0 rather use the proper type which is CryAudio::InvalidControlId in your example. So that the code would look like this.

Code: Select all

CryAudio::ControlId const triggerID = CryAudio::StringToId("Play_SoftHit"); // this should be cashed during app initialization
if (triggerID != CryAudio::InvalidControlId)
{
CryAudio::SRequestUserData const userData(CryAudio::ERequestFlags::SubsequentCallbackOnExternalThread | CryAudio::ERequestFlags::CallbackOnExternalOrCallingThread, this);
m_pIEntityAudioComponent->ExecuteTrigger(triggerID, m_audioProxyID, userData);
}

Who is online

Users browsing this forum: No registered users and 1 guest