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
Hi!
I'm using the SetMultiplePositions function, but It's only getting the last position from the array.
That's the code I have

AKRESULT success = AK::SoundEngine::SetMultiplePositions(
            staticObj.getId(), //id of the object within wwise
            staticObj.getPositions().data(), //getPositions() returns an std::vector. this converts std::vector to array
            staticObj.getPositions().size(), //number of positions passed within the array
            AK::SoundEngine::MultiPositionType::MultiPositionType_MultiDirections
            );

Does anyone have this problem too? Am I doing anything wrong?
in General Discussion by M.Bruno R. (300 points)
Did you manage to find a solution for this, we're having a similar issue where the event only plays on the root object. Here's the code, would be great if someone could look at it.

        //River to array
        AkPositionArray arr = new AkPositionArray((uint)river.transform.childCount);
        foreach( Transform child in river.transform) {
            Vector3 pos = child.position;
            Vector3 forw = child.forward;
            Vector3 up = child.up;
            arr.Add(pos, forw, up);
        }
        AkSoundEngine.SetMultiplePositions(river,arr, (ushort)river.transform.childCount, MultiPositionType.MultiPositionType_MultiSources);
        AkSoundEngine.PostEvent("ambient_river", river);
Hi! Honestly, I can't remember. This was year and half ago. I can check the code (I still have it) and see what I did to solve this (if I did).
Do you still need it?
Hi, thanks for the reply. I eventually managed to solve this issue :)
Hi! I just checked and we didn't solve it, we did a workaround. If you can, please, post your solution.
Thank you!

1 Answer

+1 vote

I don't know if it still might help, but i've been trying to set the multiposition mode using code as well, and I managed to do it. 
I've checked the code of AkAmbient.cs (Unity) and I noticed that, before setting the multiposition mode for a gameobject, all components of type "AkGameObj" are removed.

AkGameObj[] gameObj = soundpoint.gameObject.GetComponents<AkGameObj>();
for (int i = 0; i < gameObj.Length; i++)
    gameObj[i].enabled = false;

I added this portion of code in my soundmanager, before setting the multiposition mode, and now it works :) 

 

by Slimane D. (170 points)
...