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.

–1 vote
Trying to figure out how to translate this info into C# so that we can use event callbacks with the Unity Integration:  http://kb.gowwise.com/questions/174/How+can+I+be+notified+when+an+event+has+finished+playing%3F

If anyone has an example of how to use them, that would be rad.  Essentially I'm just trying to find out when an event has finished and use that to trigger further actions.
in General Discussion by Joel G. (190 points)
edited by Bernard R. (Audiokinetic)

1 Answer

0 votes

There is an example of using a callback in the Unity Integration Demo project.  Check the MarkerCallback scene.  But in short, it works the same way as in C++.  For example:

AkSoundEngine.PostEvent("MyEvent", gameObject, AK_EndOfEvent, MyCallbackFunction, myCookieObject);

void MyCallbackFunction(object in_cookie, AkCallbackType in_type, object in_info)

{

if (in_type == AK_EndOfEvent)

{

   AkEventCallbackInfo info = (AkEventCallbackInfo)in_info; //Then do stuff.

}

}

You can find more info in the Unity doc that comes in the Unity package, or in the AkCallbackManager class, or in the SDK doc (comes with the Wwise installation).  Also note we have another Unity demo project for the 2014.1 version that also demonstrate the use of callbacks.  Check it out!

by Mathieu J. (Audiokinetic) (7.1k points)
Thanks for the reply Mathieu, we have it working now :)
I see the subtitle demo in the "Wwise Unity 5 Demo Scene" but I don't see a MakerCallback scene or a Unity Integration Demo anywhere. Am I missing it? Do any of these Unity integration demonstrate Midi callbacks?
...