Version
menu_open
Wwise Unreal Integration Documentation
Using the Wwise Unreal Niagara Integration

You can use Unreal's Niagara VFX system to build complex effects system with visual programming paradigms. For additional information about the Niagara system, refer to the Niagara Overview.

The Wwise Unreal Integration provides the necessary code and Niagara modules to post and update Wwise Events from within a Niagara system.

Activating the Plugin

The plugin can be installed as an Engine or Game plugin. It is installed automatically alongside the Wwise Unreal Engine Integration plugin. After the plugin is installed, you can activate it in the Unreal Editor. To activate it, select Edit > Plugins and then select Wwise Niagara Integration.

The Niagara Wwise Event Data Interface

The integration includes a Niagara Data Interface for Wwise Events, which you can use to reference Wwise Event and Game Parameter assets in their Niagara systems. This Data Interface is only compatible with Niagara CPU simulations. You can use it to post fire-and-forget Events, as well as persistent Events, which can be controlled as the simulation progresses. In the case of persistent Events, the data interface tracks an internal "audio handle" which is used to map particle or emitter instances to posted Events.

Note:
If you want to use Wwise Events in a GPU simulation, you can use the Export Particle Data Module as shown in Exporting Particle Data to Blueprints.

Parameters:

  • Event to Post (Required): The AkAudioEvent asset to post.
  • Max Plays per Tick (Default: 10): This sets the maximum number of Events posted on each tick. If more particles try to play a sound in a given tick, sounds are played until the limit is reached and the rest are discarded.
  • Stop when Component is Destroyed (Default: True): Stops the Event when the Niagara component is destroyed (particle death, or the system is stopped or destroyed). Looping sounds are always stopped when the component is destroyed.
  • Only active During Gameplay (Default: False): Only processes sounds during active gameplay, and not while using Realtime Rendering in the open viewport. This is useful when you are working in the preview window and you do not want to hear the sounds.
  • Game Parameters: A set of Game Parameters updated (through their index) in the Set Wwise Persistent Event Game Parameter module.

Niagara Modules

The Niagara Wwise Event Data Interface implements functions for posting Events and updating their playback and GameObject parameters. These functions are available in Niagara modules, but not directly in a Niagara emitter's stack. The integration includes a set of basic Niagara modules which expose each of these functions to the Niagara stack.

Note:
These modules are inside a plugin, so when you add a new module to a script, you must select the Plugins filter in order for them to appear in the Add new Module selection box.

Post Wwise Event at Location

Parameters:

  • Post Event Condition (Default: True): Boolean condition that must be met for the Event to post.
  • Position (Default: System/Emitter/Particle position): Spatial position of the posted Event.
  • Rotation (Default: 0): Spatial rotation of the posted Event.
  • Wwise Event Data (Required): A Niagara Wwise Event Data Interface.
  • Position Coordinate Space (Default: Simulation): The coordinate system used for the Position coordinates. Set to Simulation to match the Emitter settings (in which case the World coordinates are sent to Wwise), Local for a position relative to the emitter, and World to use World space.

Behavior:

This module posts "fire-and-forget" Events, which do not require management during a particle or the emitter's lifetime. This module posts the Event on a temporary GameObject at a given location, with a given orientation.

Note:
Events with infinite duration cannot post with this method, because there is no way to stop them outside of a call to StopAll().
Warning:
Posting a large number of Wwise Events in a short time frame from a particle system can overload the sound engine. Ensure that you limit the number of Events the system can post per frame, or set playback limits in your Wwise project.

Post Wwise Persistent Event

Parameters:

  • Post Event Condition (Default: True): Boolean condition that must be met for the Event to post.
  • Position(Default: System/Emitter/Particle position): Spatial position of the posted Event.
  • Rotation(Default: 0): Spatial rotation of the posted Event.
  • Wwise Event Data (Required): A Niagara Wwise Event Data Interface which references the persistent Event when it is updated.
  • Position Coordinate Space (Default: Simulation): The coordinate system used for the Position coordinates. Set to Simulation to match the Emitter settings (in which case the World coordinates are sent correctly sent to Wwise), Local for a position relative to the emitter, and World to use World space.

Behavior: Creates an AkComponent at the given position with the specified rotation and posts the provided Event on it. The AkComponent for a given posted Event is kept alive by modules in the update loop. This ensures that if particles die or are culled, the AkComponents are destroyed and do not leak memory. If the modules are not updated in the Update scripts (System, Emitter, Particle), then the AKComponents are destroyed. In this case, one frame of audio is played after the post, and is immediatley killed. Whether the posted Event stops when its component is destroyed depends on the Stop when Component is Destroyed settings on the Niagara Wwise Event Data Interface.

If this module is placed in an Update stage of the Niagara system, the Event is only posted once per instance (emitter or particle) when the Post Event Condition is met, and keeps the AkComponent alive. If other persistent Event modules are used in the update stage, they keep the AkComponent alive, and the Post Persistent Event module can be placed instead in a Spawn stage of the emitter stack.

Note:
When using Persistent Events, it is critical to use the same attribute for the Wwise Event Data parameter in modules that deal with the same persistent Event. Using the same attribute makes the instance data associated with each particle available in other modules. This attribute can be at the User, System, or Emitter level.

You can use the following modules to control playback of the persistent Event, set Game Parameters on the AkComponent's GameObject, or update the AkComponent's position and orientation, which then update the GameObject within the Sound Engine.

Update Wwise Persistent Event Position

Parameters:

  • Position (Default: System/Emitter/Particle position): Spatial position of the posted Event.
  • Wwise Event Data (Required): Reference to the Event Data that was set in Post Wwise Persistent Event
  • Position Coordinate Space (Default: Simulation): The coordinate system used for the Position coordinates. Set to Simulation to match the Emitter settings (in which case the World coordinates are sent to Wwise), Local for a position relative to the emitter, and World to use World space.

Behavior:

Sets the AkComponent's position.

Update Wwise Persistent Event Rotation

Parameters:

  • Rotation (Default: 0): Spatial rotation of the posted Event.
  • Wwise Event Data (Required): Niagara Wwise Event Data Interface.

Behavior:

Sets the AkComponent's rotation.

Set Wwise Persistent Event Game Parameter

Parameters:

  • Game Parameter Index (Default: 0): Index of the Game Parameter in the Wwise Event Data's "Game Parameters" array.
  • Game Parameter Value (Default: 0): Desired Game Parameter value
  • Wwise Event Data (Required): Reference to a Wwise Event Data Interface.

Behavior:

Sets the Game Parameter value on the AkComponent's GameObject.

Stop Wwise Persistent Event

Parameters:

  • Stop Condition (Default: True): If true, stops the Event playback.
  • Wwise Event Data (Required): Reference to a Wwise Event Data Interface.

Pause Wwise Persistent Event

Parameters:

  • Pause Condition (Default: True): If true, pauses the Event playback. If false, playback resumes
  • Wwise Event Data (Required): Reference to a Wwise Event Data Interface.

Best Practices For Limiting Active Events

Monitor the Wwise Profiler closely when designing Niagara systems that post Wwise Events. Use the Max Plays per Tick parameter to help limit the load on the SoundEngine when the number of spawned particles is excessive, but if the audio Events are long enough, this can still lead to a large number of concurrent voices. Use the object playback limit settings in the Wwise project to set a hard limit on the number of voices a particle system can spawn.

Exporting Particle Data to Blueprints

The Export Particle Data module provides an alternative solution to connect a Niagara system to the Wwise Sound Engine. This module exports arbitrary particle data to a Blueprint which implements the Receive Particle Data interface. You can then use any Wwise Integration features which are exposed in Blueprints. By default, the Export Particle Data module exports two vectors and a float value, which can pass information about each particle such as its position, velocity, persistent ID, or age.

Wwise Niagara Samples

The Wwise Integration Unreal Gyms project provides sample Niagara systems that demonstrate how to use the aforementioned Niagara Wwise Event Data interface and its modules, as well as Niagara systems and Blueprint actors that demonstrate how to use the Export Particle Data with both CPU and GPU particle systems.

These samples post persistent Events that follow particle trajectories, set Game Parameters on those Events, and post fire-and-forget Events when particles collide.

Note:
The sample GPU particle system requires the Generate Mesh Distance Fields" rendering setting to be enabled.

Using the Wwise Niagara Modules in Older Versions of Unreal

The provided Niagara modules are compatible with Unreal 5.X and later. If you are using Unreal 4, you can still use the provided Wwise Niagara functions, but you must recreate the relevant Niagara modules.

You can do this by creating an asset of type FX > Niagara Module Script.

Post Wwise Event at Location

Post Persistent Wwise Event

Update Persistent Event Position

Update Persistent Event Rotation

Set Persistent Event Game Parameter

Stop Persistent Wwise Event

Pause Persistent Wwise Event


Was this page helpful?

Need Support?

Questions? Problems? Need more info? Contact us, and we can help!

Visit our Support page

Tell us about your project. We're here to help.

Register your project and we'll help you get started with no strings attached!

Get started with Wwise