Questions et réponses de la communauté

Bienvenue sur le forum de questions et réponses d'Audiokinetic, propulsé par la communauté. C'est l'endroit où les utilisateurs de Wwise et Strata s'entraident. Pour obtenir une aide directe de notre équipe, veuillez utiliser la page « Tickets de soutien ». Pour signaler un bug, utilisez l'option Bug Report dans l'Audiokinetic Launcher. (Veuillez noter que les rapports de bug soumis au forum questions-réponses seront rejetés. L'utilisation de notre système de rapport de bug dédié garantit que votre rapport est vu par les bonnes personnes et a les meilleures chances d'être corrigé.)

Pour obtenir rapidement les meilleures réponses, suivez ces conseils lorsque vous posez une question :

  • Soyez précis : qu'essayez-vous de réaliser ou quel est le problème spécifique que vous rencontrez ?
  • Pensez à inclure les détails importants : incluez des détails tels que les versions de Wwise et du moteur de jeu, le système d'exploitation, etc.
  • Expliquez ce que vous avez essayé de faire : indiquez aux autres les mesures que vous avez déjà prises pour essayer de résoudre le problème.
  • Concentrez-vous sur les faits : décrivez les aspects techniques de votre problème. Se concentrer sur le problème aide les autres personnes à trouver rapidement une solution.

+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

dans General Discussion par Simon S. (280 points)

1 Réponse

–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. :)
par 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.
...