Space Shooter: Posting Wwise Events — AKEvent Component

In this article I’ll go over 1 basic way to post an event from Wwise. The first way is simply with the AKEvent Component. There are lots of ways and this way is easiest for this demo.

First I need to cover how to create an event in Wwise and get that event to show up in Unity.

CREATING AN EVENT IN WWISE:

Navigate to Layouts > Designer on the top of the screen. This brings you to the Designer Layout. From here you can create events, import audio files, and determine what to do with them like loop, randomize pitch, volume, etc. I’ll go more in depth on that later.

In Wwise, on the left side of the screen you’ll see the project explorer view. In the audio tab you’ll see several folders and things called “Work Units”.

You can learn more about work units here, but in short, a work unit is an XML file. If you have several people working on a project, for example, one team is working on gun sounds, another is working on environment sounds, etc, each team will have its own work unit in effort to avoid merge conflicts when merging their work into the main branch of their repo.

Learn Wwise | Audiokinetic

There are lots of ways to create an event in Wwise. I like to import the audio file and then create an event from it. So for this demonstration, I’ll import an explosion sound.

In the Actor-Mixer Hierarchy I’ll right click, and make a new Work Unit called Explosion Sounds.

Within this work unit I will right click and select “SFX”. Then Right click that and select “import audio”. I’ll find an audio file on my hard drive and chose it to be imported. Once its imported you can see the sound property editor view has populated with all kinds of stuff! Theres volume control, looping, effects, positioning, etc. For now I want to assign the imported audio file to an event.

I’ll right click the audio file and go to “new event > Play”. Now if you navigate to the Events tab, you should see this event under the Default Work Unit.

I like to make a SFX work unit and a Music Work Unit. I’ll do that and then drag this event into that work unit.

Now we need to create a sound bank. I like to keep it simple here as well. Later on we can get into more detail about making several sound banks for several different scenes in order to make the game more performant. For now I’ll make a single sound bank called “General” outside of the default work unit. I dont like to use default anything lol.

Now I’ll navigate to the Layouts tab at the top and select “SoundBank”. From here you assign what events you want in which sound banks. For now I’ll be housing the 2 new work units I made from the events tab into the general sound bank Hierarchy inclusion view.

Now anything I place inside these work units will automatically be added to this sound bank.

Now all thats left is to generate the sound banks.

Save the Wwise project and hop into Unity.

We can now see the event and the soundbanks in the Wwise picker! If you dont see the Wwise picker just go to Window at the top. It should be listed there.

Lets make a sound play.

PLAYING A SOUND THROUGH AKEVENT COMPONENT:

Find your Explosion prefab. The one used to make the asteroid at the beginning of the game explode. Clcik add component and type AKEvent. Select that. You’ll see that you need to assign an event.

Drag the Explosion sound from the wwise picker to the name field.

There are parameters as well like when to trigger this event. I want to trigger this event on start because the explode prefab is instantiated. When its instantiated it will play this event. Perfect!

But in order to hear the sound you have to load the correct bank. SO I’ve made a Wwise Bank Loader empty game object and attached an AKBank component to it. I have assigned the general bank from the wwise picker to the Name field.

Now if you play the game and blow up the asteroid it will play the explode sound. Easy right!?

In the next article I’ll cover how to post an event from a script and showcase how much easier it is to randomize a sound. The laser sound will be slightly different each time we fire it giving this game a little bit more detail. Its the small details after all that make all the difference :) Look forward to seeing ya there!

result here:

https://youtu.be/N0W0J0korVw

--

--

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store