menu
 

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.

+2 votes

I get a bug when using AkSoundEngine.GetPlayingIDsFromGameObject in Unity. Here's my code:

uint[] playingIds = new uint[50];
uint count = 0;
AKRESULT result = AkSoundEngine.GetPlayingIDsFromGameObject(gameObject, ref count, playingIds);

If an event is plyaing on the gameObject this results in a count > 0 but playingIds is always full of only 0 (it doesn't contain any playing ids. This must be a bug right?

Edit: I'm on Wwise 2019.1.1.6977

in General Discussion by Simon S. (280 points)

1 Answer

–1 vote
the 2nd argument was explained in SDK:

"Number of items in array provided / Number of items filled in array",

you should change the initial value of the "count" to 1 or bigger. :)
by 05 (500 points)
I don't think this is correct. The SDK actually has a note about this:
"Note: It is possible to call GetPlayingIDsFromGameObject with io_ruNumItems = 0 to get the total size of the structure that should be allocated for out_aPlayingIDs."
https://www.audiokinetic.com/en/library/edge/?source=SDK&id=namespace_a_k_1_1_sound_engine_1_1_query_a8263cb018517fadf2220ca00d88f907f.html

You'll notice that the 3 arguments listed have "in_", "out_" or "io_" prefixes.  

```
AkGameObjectID in_GameObjId,
AkUint32& io_ruNumIDs,
AkPlayingId* out_aPlayingIDs
```

It expects a valid GameObjectId as an input, it outputs the PlayingIDs to the out_aPlayingIDs, but the 2nd argument has an "io_" prefix to note that it is both an input AND an output. If you input 0, it should update that 2nd reference argument with the correct number of PlayingIds that get returned in out_aPlayingIDs.  That's super useful if you need to iterate over the expected list of PlayingIds because it gives you a nice number to use for a loop over the raw pointer out_aPlayingIDs.

I'm having the same problem as OP though where I post an Event from a specific AkComponent, then I use GetPlayingIDsFromGameObject after the event has been posted and the AKRESULT returns AK_Fail.
Also having this issue in Wwise 2022_1. NumIDs might come back with a value greater than 0 but the actual id's in the array are all 0.
...