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.

0 votes

I'd like to ensure that the value we just tried to set with SetSwitch exists. I assumed I could do this with a call to GetSwitch after the SetSwitch call. We compare the target value we tried to set with the value returned from the GetSwitch call to ensure that they're the same.

However, I find that when calling AK::SoundEngine::Query::GetSwitch the returned switch state "out_rSwitchState" is assigned a value of 0.

AKSOUNDENGINE_API AKRESULT AK::SoundEngine::Query::GetSwitch

(

AkSwitchGroupID 

in_switchGroup,

 

 

AkGameObjectID 

in_gameObjectID,

 

 

AkSwitchStateID

out_rSwitchState 

 

)

The documentation for SetSwitch states that it always returns success (regardless of whether the switch value exists in the project) so its return value is of no use to me.

AKSOUNDENGINE_API AKRESULT AK::SoundEngine::SetSwitch

(

AkSwitchGroupID 

in_switchGroup,

 

 

AkSwitchStateID 

in_switchState,

 

 

AkGameObjectID 

in_gameObjectID 

 

)

 

 

Sets the State of a Switch Group (by IDs).

Returns

Always returns AK_Success

When passed a switch state that doesn't exist (invalid hash/unrecognised string) the SetSwitch silently fails and the switch group is assigned the default switch group value.

I haven't seen anything in the documentation to suggest that making a GetSwitch call straight after a SetSwitch call is invalid so... what's going on here?

in General Discussion by Gareth M. (120 points)
closed by Gareth M.
...