Working with audio in Unreal Engine 4

Sep 15, 2020 at 10:00 am by nemirc

Working with audio in Unreal Engine 4

As you know, I've been using Unreal Engine 4 for a few months now, and I've learned a few very interesting things. This time I will show you some audio-related features in UE4. Right now, UE4 only imports uncompressed .WAV files, unlike Unity that lets you import MP3 files as well.

In UE4 there are basically two ways to use audio.

First, you can use the audio asset directly as an audio source that can be placed inside your level, or you can use an Audio Cue. If you use the audio directly, you have to configure the volume, attenuation, looping, etc., directly. Depending on the setting you need to modify, you do it in the sound asset or the ambient sound actor. For example, you control looping and pitch in the audio asset, but you control volume and attenuation distance in the actor.

On the other hand, Audio Cues give you a lot more control and let you do a lot of very interesting things. You can obviously do basic things like setting the looping, volume and attenuation. This lets you have different cues (using the same audio file) for different needs. For example, one that could be used for an exterior and plays a rain at full intensity, but another one that plays when you are in the interior, and play with those settings to make the rain sound less loud.

When using Audio Cues you can also add multiple audio files. This can be very useful if you want to mix a lot of audios for a specific thing. For example, if your ambient sound will feature creaks, little crawling animals, wind, and distant footsteps, you can add all those into a single cue so they all play at once. I am doing this right now to combine wind and insects into a single cue rather than adding various cues to the level.

In an Audio Cue you can set the sound class, and this can be very useful if you want to control volumes separately, something games do all the time.

A very useful feature in Audio Cues is the ability to control the attenuation. In other engines, you are only able to use a radial attenuation, but here you can use other shapes if you create your custom attenuation class. For a demo of our current project I am actually using a cube attenuation for a long hallway with a lot of windows, and a cylindrical attenuation for a gate.

Audio Cues are also very useful when adding footstep sounds. If you have multiple footstep sounds, you can use a node to randomize which one is picked every time the cue is played, and this is a small detail that adds audio variety to your game, adding to the overall perceived quality.

While there are a lot more audio-related features in UE4, these can give you a broad idea of what this engine can do for your games. You should definitely take the time to learn more about Audio Cues and see what else you can do.

Sections: Tips + Tutorials

This website uses cookies to ensure you get the best experience possible More Info
Got it!