Community Q&A

Welcome to Audiokinetic’s community-driven Q&A forum. This is the place where Wwise and Strata users help each other out. For direct help from our team, please use the Support Tickets page. To report a bug, use the Bug Report option in the Audiokinetic Launcher. (Note that Bug Reports submitted to the Q&A forum will be rejected. Using our dedicated Bug Report system ensures your report is seen by the right people and has the best chance of being fixed.)

To get the best answers quickly, follow these tips when posting a question:

  • Be Specific: What are you trying to achieve, or what specific issue are you running into?
  • Include Key Details: Include details like your Wwise and game engine versions, operating system, etc.
  • Explain What You've Tried: Let others know what troubleshooting steps you've already taken.
  • Focus on the Facts: Describe the technical facts of your issue. Focusing on the problem helps others find a solution quickly.

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.
...