Audiokinetic's Community Q&A is the forum where users can ask and answer questions within the Wwise and Strata communities. If you would like to get an answer from Audiokinetic's Technical support team, make sure you use the Support Tickets page.

Is it possible to know when a sound has finished playing?

0 votes

We need a sort of callback to Unity/whatever to let us know when a sound is finished playing with Wwise. Is this possible? Or is there another method for doing it?

I was able to find the following about estimating duration of audio files under "SoundBank Settings - SoundBanks Tab":

"Event info: Estimated duration
Attempts to determine the expected duration of each event in a SoundBank. For each event, a DurationType, MinDuration, and MaxDurations attribute will be included in the soundbanksinfo.xml file. The DurationType may be one of: "OneShot", "Infinite", "Mixed" or "Unknown". "OneShot" indicates a non-looping sound; "Infinite", a looping sound; "Mixed", a sound which may or may not loop infinitely (possibly based on random chance or a switch), and "Unknown" indicates that Wwise was not able to determine the duration. The MinDuration and MaxDuration attributes attempt to place a lower and upper bound on the duration of an event. Note that these bounds are only an estimate and may or may not be accurate depending on runtime conditions.
"

It seems like it does something like what I want. Still, is it possible to get a callback for when a sound has finished playing?

asked Apr 21, 2015 in General Discussion by Egil S. (110 points)

1 Answer

+3 votes
You should look into the AK_EndOfEvent callback. You can refer to the Wwise SDK documentation documentation for the AkCallback.h file.
answered Apr 22, 2015 by Benoit S. (Audiokinetic) (16,020 points)
Perfect!

Thanks for pointing me in the right direction.
...