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

This is a question sent to us from elsewhere and shared here to benefit everyone.  

How do I create a Wwise-Type Event parameter for an Animation Event function?
Unfortunately, you cannot. This is a limitation of Unity's Animation Events system. However, there are other ways to reference a certain Wwise Event directly from an Animation Event. 
* You can read more about Animation Events in the Wwise-301 course

1) Type the Event Name into a String

Animation Events do accept String parameters, which is basically just text. Luckily, that's exactly what the AkSoundEngine.PostEvent() function requires when you want to post an Event from code. Here's an example of creating such a function.

public void PlayWwiseEvent(string NameOfEvent) {
     AkSoundEngine.PostEvent(NameOfEvent, this.gameObject)    
}

2) Create an Enum dropdown
If you want a Wwise-Type-like dropdown, you can also create n enum instead of a string. 

This method is most useful when you know the name of your Events, cause you will have to add the names manually to the enum if you create new ones or modify existing Event names. 
Start by defining the enum. Add the names of all your Events separated by a comma. Then, in the function inputs, add a new parameter based on that enum and make sure to ToString() the parameter in the PostEvent function, so you convert the enum selected into text. 

public enum WwiseEvents { Explosion, Open_Door, Close_Door, TakeFootstep, Sword_Impact, Gunshot }
public void PlayWwiseEvent(WwiseEvents Event) {
    AkSoundEngine.PostEvent(Event.ToString(), this.gameObject);  
}

closed with the note: This is a question sent to us from elsewhere and shared here to benefit everyone.
in General Discussion by Mads Maretty S. (Audiokinetic) (40.2k points)
closed by Mads Maretty S. (Audiokinetic)
...