在 Audiokinetic 社区问答论坛上,用户可对 Wwise 和 Strata 相关问题进行提问和解答。如需从 Audiokinetic 技术支持团队获取答复,请务必使用技术支持申请单页面。

Why does AK::SoundEngine::Query::GetSwitch return a switch state of 0? [已关闭]

0 投票

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?

最新提问 2月 9, 2022 分类:General Discussion | 用户: Gareth M. (120 分)
已关闭 2月 11, 2022 用户:Gareth M.
...