Triggering Audio in game

Overview

Triggering audio is usually done via two common methods, via Flow Graph or via Trackview. This article will show you how to setup in either method.

Triggering in the level itself

Many times sounds can simply be placed in the level as and active Sound Event Spot (SES). This is mainly used for static environmental sounds such as humming and buzzing of a electrical fuse box or dripping water from a water barrel.

You can still link these SES to an area trigger to only activate them when the player is near and vice versa.

Triggering in Flowgraph

Other sounds are designed to be turned on or off based on events during game play. To have a sound play simply link a SoundEventSpot to any of the many available trigger methods in the Flow Graph. The Flow Graph Editor can be used to trigger single-event sounds, as well as start and stop looping sounds. By placing a sound entity in a Flow Graph, it becomes an Entity FlowNode. Most of the properties then become input ports whose values can be changed. This is done by linking other FlowNodes, such as trigger or logic FlowNodes, to the input ports of the sound FlowNode. The most common and easiest method is to connect a trigger FlowNode to the play port of a FlowNode.

In this example the player would enter an area trigger and activate a one shot sound event spot for a falling statue.

Triggering in Track View

2D Sound

  1. Select a SoundEventSpot and enable it.
  2. Click the Add Selected Node icon in the Track View sequence to create a node.
  3. Click the Event track at the point where you would like to trigger a sound. This creates a key (you can adjust the time later).
  4. Select the Key to bring up its properties window.
  5. From the Event drop-down list, select Play.

3D Sound played on an object

To add a 3D sound to an object, open the Track View by going to View -> Open View Pane -> Track View.

  1. Select an object in the level.
  2. Click the Add Selected Node icon in the Track View sequence to add a node.

3. Right-click the Event and select Add Track -> Sound to add a sound track.

4. Click the Add Key icon, and then click at the point in the Sound track where you would like the sound to be triggered.

5. Select the Key to bring up its properties window.

6. Select the SoundEvent under Sound File.

7. Select the Voice check box if this is a dialog sound, even if it does not have lip-sync animation.

8. Use the following parameters only if you reference a wave file for rapid prototyping:

  • Set the Volume from zero to one
  • Set the Pan
  • Select 3D sound, if required
  • Select whether or not it should loop
  • Define the In and Out Radius
  • Select streaming, if required

9. For sound events, ensure the following:

  • Volume should be set to one
  • Pan and Out/In Radius are set to zero
  • Looping should not be selected

Sound for Complex Scripted Events

Often, complex scripted events are done in Track View. There are several ways to implement a sound in a scripted event. First, it depends on the player's allowed freedom of interactivity. Let's take three different scenarios:

  • Pure cinematic: no interaction, pre-determined camera movements
    In a pure cinematic situation, without any interaction, the Track View can be used to trigger 2D sound events without the need of any real-time 3D world parameter updates. Similar to a regular movie, everything can be designed in the audio files, as desired. As the frame rate may fluctuate, you can break the sound track into shorter sound events to ensure a constant re-synchronization to the picture. The more the freedom and interactivity allowed, the more the 3D sound events and real-time parameter updates are needed.
  • Interactive cinematic: player position is locked, but can turn his head in the 1st person perspective
    If the player is turning his head, he constantly affects the angle to the sound, but does not affect the distance to it. In this case, the 3D positioning of sound events is necessary. However, due to the player's fixed position, no distance parameter is necessary. Furthermore, if there is a moving object like a jet flying by, one can use an original recording of a passing jet as a one shot. The jet will be assigned as the emitting entity (attach the sound event as described in the above example, with the US_ltv1).
  • Player has unrestricted movement and full world interaction
    Perhaps the most interesting, but also a complex and challenging way to deliver sound in a scripted event, is by using the full interactivity of the player. Therefore, it is best practice to take advantage of all the 3D world parameters, in combination with well-balanced sound events and smooth distance transitions. This can be a good place to use stereo sound events, with speech spread over a distance.