๐Ÿ”ŠAudio

Unreal Engine Documentation

This page will only provide a brief overview of audio content, and how it works within an Origin project. As we are working with the Unreal Engine native audio solution, it is advised to read the Unreal Engine Documentation on Working With Audio.

Overview

Audio content in Unreal falls into several asset types, the most common being as follows:

  • SoundWave: This is a single piece of audio with a list of configurable properties. It can be played back from an AudioComponent as is, or added to a SoundCue or MetaSoundSource.

  • SoundCue: This is a legacy system for playing back SoundWave assets with additional behaviours. For example, you can have a collection of sounds that are randomly played each time the SoundCue is triggered. It is not recommended to use SoundCues, as all of the functionality is provided by MetaSoundSources, and the asset type may be depreciated in a future engine update.

  • MetaSoundSource: This is an asset that allows the combination of multiple SoundWaves with synthesisers, effects and various other effects, behaviours and forms of manipulation.

It is recommended to use SoundWaves for most content, only using MetaSoundSources when more complex behaviour is required, such as:

  • Choosing a random sound from a pool and playing it each time the sound is triggered.

  • Mixing multiple sounds together.

  • Blending between two or more sounds over a distance.

  • Manipulating a sound with effects.

  • Parameter-based behaviour that can be controlled by Blueprints.

Importing Audio

How should I import audio content?

Assets should be imported from an uncompressed .wav file (therefore allowing Unreal to compress the audio), which can be done by simply dragging and dropping a .wav file from Windows into the Content Browser. This will create a SoundWave.uasset with an identical name to the source audio .wav file.

How to Make Audio Respond to the Volume Settings

The settings menu (hitting ESC in-game) has controls for audio:

In order to have your game sounds affected by the audio volume sliders, you need to ensure that you have correctly set their SoundClass.

This can be accomplished in two ways:

  • Setting the SoundClass on the asset itself (strongly recommended, see below).

  • Setting a Sound Class Override on an actor.

For example, if you have an AmbientSound actor, you can make it respect the Music Volume slider by adding the following SoundClass override:

Important Audio Asset Properties

Origin uses a number of audio systems, which are described in further details on the Audio Systems page. Many of our systems rely on correctly setting parameters on imported content. It is also important to be aware of the hierarchy of properties - i.e. some properties (such as Attenuation) on a SoundWave is ignored if the SoundWave is used in a MetaSoundSource.

The hierarchy is as follows:

  • AudioComponent: This component is required to play any sound, and any properties set on the component will override those on any assets being played through it.

  • SoundCue / MetaSoundSource: These assets contain and combine SoundWaves, and will override the properties defined on any SoundWave they contain.

  • SoundWave: This is the "lowest-level" and most simplistic audio .uasset.

As a consequence of this, if an Attenuation property is set on a SoundWave, but the SoundWave is played inside of a MetaSoundSource with no Attenuation setting, then the outputted audio will be in 2D (i.e. with no attenuation or spatialisation).

Important properties to be aware of:

  • SoundClass: This property defines the "category" of a sound and to which channel of the mixer system the audio will be routed. For example, this system is used by volume sliders in the pause menu. Adjusting the UI slider will only change the volume of sounds that are being sent to the UI channel, which can be accomplished by setting the SCL_M2_NonWorld_UI SoundClass.

  • Attenuation: This property defines the spatial behaviour of a sound - i.e. how it behaves in 3D space. The default null value will play a sound in 2D (i.e. it will sound the same regardless of your position, orientation, etc.) Using an Attenuation asset with spatialisation will make the sound play from a world location (i.e. the location of the AudioComponent that is playing it).

Note that is it not possible for a non-spatialised sound to have attenuation, but it IS possible for a spatialised sound to NOT have attenuation (i.e. a sound that plays from a point in the world, but never gets quieter, regardless of how far away you are.)

  • Looping: This property (when true) will set a sound to repeatedly play in a continuous loop. This is useful for ambient sounds, like running water in a river. If there is a noticeable gap where a sound stops and starts, it will ruin the immersion, so a continually looping sound will better simulate the sound of a flowing river.

Note: volume multipliers in Unreal are multiplicative, so setting the volume of a SoundWave to 0.5, then adding that SoundWave to a MetaSoundSource, and setting its volume to 0.5, will result in the sound playing at a volume of 0.5 multiplied 0.5, or 0.25. This also means that a sound can be muted by setting its volume to zero at any stage.

Last updated