π Sound in Unreal
Sound transforms a visual experience into an immersive one. The crack of a gunshot, the ambience of a forest, the music that swells during a boss fightβaudio is half of the player's experience. In this lesson, you'll learn how Unreal Engine handles audio, from importing sound files to understanding the different audio systems available.
π― Learning Objectives
By the end of this lesson, you will be able to:
- Import audio files in supported formats
- Understand Sound Wave assets and their properties
- Differentiate between Sound Cues and MetaSounds
- Explain 2D vs 3D spatialized audio
- Configure Sound Classes and Mix settings
Estimated Time: 35-45 minutes
Prerequisites: Module 5 (Blueprints basics)
π In This Lesson
Audio in Unreal Engine
Unreal Engine provides a comprehensive audio system that handles everything from simple sound effects to complex, procedural audio compositions. Understanding the audio pipeline helps you create rich soundscapes that respond to gameplay.
The Audio Pipeline
Sound in Unreal follows a clear path from source to speaker:
- Sound Wave: The raw audio file imported into Unreal
- Sound Asset: Sound Cue, MetaSound, or direct Sound Wave reference
- Audio Component: The component that plays the sound on an Actor
- Sound Class: Categorization for volume control (Music, SFX, Voice)
- Sound Mix: Master volume controls and effects
- Output: Final audio sent to speakers/headphones
Figure: Audio flows from imported files through processing to final output.
Audio Engine Features
Unreal's audio engine provides powerful features:
Spatialization: 3D positioning of sounds in the game world. Sounds get louder as you approach, quieter as you move away, and pan left/right based on direction.
Attenuation: How sound volume decreases over distance. Configure falloff curves, maximum audible range, and occlusion (sounds muffled through walls).
Reverb: Environmental effects that simulate sound reflections in different spaces (cave echo, outdoor openness, small room).
Real-time Mixing: Adjust volumes, apply effects, and duck certain sounds based on gameplay state.
Procedural Audio: With MetaSounds, generate audio algorithmically rather than playing static files.
Audio Asset Types
| Asset Type | Description | Use Case |
|---|---|---|
| Sound Wave | Raw imported audio file | Simple sounds, source for other assets |
| Sound Cue | Node-based sound processing | Randomization, layering, simple logic |
| MetaSound | Procedural audio graph | Complex, dynamic, procedural audio |
| Sound Class | Category for volume grouping | Separate Music/SFX/Voice controls |
| Sound Mix | Master mix settings | Overall volume, ducking, effects |
| Sound Attenuation | Distance falloff settings | 3D sound behavior configuration |
| Reverb Effect | Environmental reverb preset | Cave, hallway, outdoor ambience |
Importing Audio Files
Before you can use sounds in Unreal, you need to import them. Understanding supported formats and import settings helps ensure your audio sounds great and performs well.
Supported Audio Formats
Unreal Engine supports several audio formats:
.WAV (Recommended):
- Uncompressed, highest quality
- Best for short sound effects
- Unreal compresses during cooking
- 16-bit or 24-bit, any sample rate (44.1kHz or 48kHz typical)
.OGG (Ogg Vorbis):
- Compressed, smaller file size
- Good for longer sounds (music, ambient loops)
- Slight quality loss vs WAV
- Streams well for large files
.FLAC:
- Lossless compression
- Smaller than WAV, same quality
- Good middle ground
π‘ Format Recommendation
Import as WAV for the best quality. Unreal will compress audio during packaging based on your platform settings. This gives you maximum flexibilityβyou're not double-compressing already-compressed files.
Importing Sound Files
- Prepare your audio file (WAV recommended, 44.1kHz or 48kHz)
- In Content Browser, click Import or drag files directly
- Navigate to your audio file(s) and select them
- Choose destination folder in your project
- Click Import
Unreal creates a Sound Wave asset for each imported file.
Sound Wave Properties
Double-click a Sound Wave to open its properties:
General:
- Duration: Length of the sound in seconds
- Sample Rate: Audio quality (44100 Hz typical)
- Channels: Mono (1) or Stereo (2)
Sound:
- Volume: Base volume multiplier (0.0 - 1.0+)
- Pitch: Playback speed/pitch multiplier
- Sound Class: Category assignment (SFX, Music, etc.)
Compression:
- Loading Behavior: How the sound loads into memory
- Compression Quality: Trade-off between size and quality
Figure: Sound Wave assets show waveform preview and configurable properties.
Loading Behavior Options
How a sound loads into memory affects both performance and memory usage:
Retain on Load: Sound stays in memory once loaded. Best for frequently used sounds (footsteps, gunshots).
Prime on Load: Loads async when level loads. Good for sounds needed soon after level start.
Load on Demand: Only loads when actually played. Saves memory but may cause slight delay on first play.
Stream: Streams from disk during playback. Essential for long sounds (music) to save memory. Small latency on start.
β οΈ Streaming Large Files
For music and long ambient sounds, enable streaming in the Sound Wave's Compression settings. A 3-minute music track as uncompressed audio would use significant memory. Streaming keeps only a small buffer loaded at any time.
Mono vs Stereo
Mono (1 channel):
- Required for 3D spatialized sounds
- Engine can position in 3D space
- Use for: gunshots, footsteps, voice, most SFX
Stereo (2 channels):
- Fixed left/right channels
- Cannot be properly spatialized in 3D
- Use for: music, UI sounds, ambient beds
Most 3D sound effects should be mono. Unreal will spatialize mono sounds correctly. Stereo sounds played in 3D often sound wrong because the left/right channels don't move naturally.
Sound Cues vs MetaSounds
Unreal provides two systems for processing and enhancing audio beyond simple Sound Wave playback. Understanding when to use each helps you create better audio with less effort.
Sound Cues
Sound Cues are the traditional node-based sound processing system. They let you combine and modify Sound Waves visually.
Creating a Sound Cue:
- Right-click in Content Browser
- Select Sounds β Sound Cue
- Name it (e.g.,
SC_Footstep) - Double-click to open the Sound Cue Editor
Common Sound Cue Nodes:
| Node | Purpose | Example Use |
|---|---|---|
| Wave Player | Plays a Sound Wave | Source for the cue |
| Random | Randomly selects from inputs | Varied footstep sounds |
| Modulator | Randomizes pitch/volume | Natural variation |
| Mixer | Combines multiple sounds | Layered sounds |
| Concatenator | Plays sounds in sequence | Multi-part sounds |
| Looping | Loops the sound | Ambient loops |
| Delay | Adds delay before playing | Timed sequences |
Figure: Sound Cue with random selection and pitch modulation.
MetaSounds
MetaSounds is Unreal's modern procedural audio system, introduced in UE5. It's more powerful than Sound Cues, enabling complex, generative audio.
Creating a MetaSound:
- Right-click in Content Browser
- Select Sounds β MetaSound Source
- Name it (e.g.,
MS_Laser) - Double-click to open the MetaSound Editor
MetaSound Capabilities:
- Full audio DSP (Digital Signal Processing)
- Synthesizers and oscillators
- Runtime parameter control from Blueprints
- Complex routing and modulation
- Create sounds from scratch without audio files
When to Use Each
| Criteria | Sound Cue | MetaSound |
|---|---|---|
| Complexity | Simple combinations | Complex, procedural |
| Learning Curve | Easy | Steeper (audio DSP knowledge helps) |
| Runtime Control | Limited | Extensive (parameters) |
| Procedural Audio | No | Yes (synthesizers) |
| Best For | Randomization, layering | Dynamic, reactive audio |
| Example | Random footstep variations | Engine sound reacting to RPM |
β Start with Sound Cues
For most game audio needs, Sound Cues are sufficient and easier to learn. Use them for randomized sound effects, simple layering, and basic looping. Graduate to MetaSounds when you need runtime parameter control, synthesis, or complex procedural audio.
flowchart TD
A["Need to process audio?"] -->|Simple randomization| B["Sound Cue"]
A -->|Layer a few sounds| B
A -->|Basic looping| B
A -->|Runtime parameter control| C["MetaSound"]
A -->|Procedural/synthesized| C
A -->|Complex reactive audio| C
A -->|Just play a sound| D["Sound Wave directly"]
style B fill:#4CAF50,color:#fff
style C fill:#9C27B0,color:#fff
style D fill:#667eea,color:#fff
Figure: Decision tree for choosing audio asset type.
2D vs 3D Audio
Understanding the difference between 2D and 3D audio is crucial for creating immersive soundscapes. The wrong choice can break immersion or waste resources.
2D Audio (Non-Spatialized)
2D audio plays at consistent volume regardless of listener position. It has no sense of direction or distance.
Characteristics:
- Same volume everywhere in the level
- No left/right panning based on position
- No distance-based attenuation
- Plays "in the player's head"
Use 2D audio for:
- Background music
- UI sounds (button clicks, menu navigation)
- Voice-over narration
- Global announcements
- Ambient beds (constant background)
3D Audio (Spatialized)
3D audio is positioned in the game world. Volume and panning change based on the listener's position relative to the sound source.
Characteristics:
- Volume decreases with distance
- Pans left/right based on direction
- Can be occluded by geometry
- Requires mono source for proper spatialization
Use 3D audio for:
- Footsteps
- Gunshots and weapon sounds
- Environmental sounds (waterfalls, machinery)
- Character voices in world
- Pickup and interaction sounds
Figure: 2D audio is uniform; 3D audio attenuates with distance and direction.
Sound Attenuation
Attenuation controls how 3D sounds behave over distance. Create a Sound Attenuation asset:
- Right-click in Content Browser
- Select Sounds β Sound Attenuation
- Name it (e.g.,
SA_Footsteps) - Configure distance and falloff settings
Key Attenuation Settings:
Inner Radius: Distance at which sound is at full volume. Within this radius, no attenuation.
Falloff Distance: Distance over which sound fades from full to silent. Larger = sound audible from farther away.
Attenuation Function:
- Linear: Even fade from inner to outer radius
- Logarithmic: Quick initial fade, then gradual (most realistic)
- Inverse: 1/distance relationship
- Natural Sound: Physically accurate (recommended)
Spatialization: How the sound is positioned in stereo/surround. Options include stereo panning and binaural (HRTF) for headphones.
Sound Classes and Mixes
Sound Classes categorize sounds for volume control:
- Create Sound Class asset (Sounds β Sound Class)
- Common classes: Master, Music, SFX, Voice, Ambient
- Assign sounds to classes via their Sound Class property
- Adjust class volume in settings menu (player controls)
Sound Mixes apply volume adjustments to classes:
- Create Sound Mix asset (Sounds β Sound Mix)
- Add Sound Class adjustments (volume, pitch multipliers)
- Push/Pop mixes at runtime for dynamic changes
Example Mix Uses:
- Pause menu: Duck gameplay audio, keep UI sounds
- Dialogue: Lower music when characters speak
- Slow motion: Pitch down SFX
Figure: Sound Classes organize audio for separate volume control.
π‘ Pro Tip: Set Up Classes Early
Create your Sound Classes at the start of the project and consistently assign all sounds. This makes implementing volume sliders in your options menu trivialβyou just adjust the class volume, and all assigned sounds respond.
Hands-On: Audio Setup and Sound Cue
Let's put theory into practice by importing audio, creating a Sound Cue with variation, setting up Sound Classes, and testing both 2D and 3D audio playback.
π― Exercise Goal
Import sound files, create a randomized footstep Sound Cue with pitch variation, set up Sound Classes for volume control, and understand the difference between 2D and 3D playback in practice.
Part 1: Prepare Audio Files
For this exercise, you'll need some sound files. You can:
- Use sounds from the Starter Content (if included in project)
- Download free sounds from Freesound.org or OpenGameArt.org
- Use the sounds included with Unreal's templates
Recommended sounds to gather:
- 3 footstep variations (WAV, mono, short ~0.2s each)
- 1 ambient loop (WAV or OGG, stereo, ~30s+)
- 1 UI click sound (WAV, mono or stereo, short)
Part 2: Import Sound Files
Step 1: Create Audio Folder
- In Content Browser, create folder:
Audio - Inside Audio, create subfolders:
Audio/SFXβ Sound effectsAudio/Musicβ Background musicAudio/Ambientβ Environmental soundsAudio/UIβ Interface sounds
Step 2: Import Footstep Sounds
- Navigate to
Audio/SFX - Click Import or drag files into the folder
- Select your 3 footstep WAV files
- Click Import
- Rename them:
SW_Footstep_01,SW_Footstep_02,SW_Footstep_03
Step 3: Verify Import Settings
- Double-click one of the footstep Sound Waves
- Verify it's Mono (for 3D spatialization)
- Check the waveform preview looks correct
- Click the Play button to preview the sound
Step 4: Import Ambient and UI Sounds
- Import ambient loop to
Audio/Ambient - Name it
SW_Ambient_Forest(or appropriate name) - Import UI click to
Audio/UI - Name it
SW_UI_Click
Figure: Organized audio folder structure with naming convention.
Part 3: Create Sound Classes
Step 5: Create Sound Class Assets
- In Content Browser, navigate to
Audiofolder - Right-click β Sounds β Sound Class
- Name it
SC_Master - Create additional Sound Classes:
SC_SFXSC_MusicSC_AmbientSC_UI
Step 6: Set Up Class Hierarchy
- Double-click
SC_SFXto open it - In Details panel, find Parent Sound Class
- Set it to
SC_Master - Repeat for SC_Music, SC_Ambient, SC_UI β all should have SC_Master as parent
Step 7: Assign Sounds to Classes
- Open
SW_Footstep_01 - In Details, find Sound Class
- Set it to
SC_SFX - Repeat for all footstep sounds β SC_SFX
- Set
SW_Ambient_Forestβ SC_Ambient - Set
SW_UI_Clickβ SC_UI
Part 4: Create a Randomized Footstep Sound Cue
Step 8: Create the Sound Cue
- Navigate to
Audio/SFX - Right-click β Sounds β Sound Cue
- Name it
SC_Footstep - Double-click to open the Sound Cue Editor
Step 9: Add Wave Players
- In the Sound Cue Editor, right-click the graph
- Search for "Wave Player" and add one
- Select the Wave Player node
- In Details, set Sound Wave to
SW_Footstep_01 - Add two more Wave Players for Footstep_02 and Footstep_03
Step 10: Add Random Node
- Right-click graph β Search "Random" β Add Random node
- Connect all three Wave Player outputs to the Random node inputs
- Drag from Wave Player output pin to Random input
- Random node will add more inputs as needed
Step 11: Add Modulator for Pitch Variation
- Right-click β Search "Modulator" β Add Modulator node
- Connect Random output to Modulator input
- Select the Modulator node
- In Details, set:
- Pitch Min: 0.9
- Pitch Max: 1.1
- Volume Min: 0.9
- Volume Max: 1.0
Step 12: Connect to Output
- Connect Modulator output to the Output node (speaker icon)
- The output node should already exist in the graph
Step 13: Test the Sound Cue
- Click Play Cue button in the toolbar multiple times
- You should hear different footstep variations each time
- Pitch should vary slightly for natural sound
- Save the Sound Cue
Figure: Complete Sound Cue with random selection and pitch/volume modulation.
Part 5: Create Sound Attenuation
Step 14: Create Attenuation Asset
- Right-click in
Audio/SFXβ Sounds β Sound Attenuation - Name it
SA_Footsteps - Double-click to open
Step 15: Configure Attenuation
- In Details, find Attenuation (Volume) section
- Enable Enable Volume Attenuation (should be on by default)
- Set Attenuation Function: Natural Sound
- Set Inner Radius: 100 (full volume within 1 meter)
- Set Falloff Distance: 2000 (audible up to 20 meters)
Step 16: Configure Spatialization
- Find Attenuation (Spatialization) section
- Enable Spatialize
- Set Spatialization Algorithm: Default (or Binaural for headphones)
Part 6: Test 2D vs 3D Audio
Step 17: Set Up Test Level
- Open your test level (or create a simple one)
- Make sure you have a playable character
Step 18: Add 3D Sound Source
- In the level, create an empty Actor or use an existing mesh
- Add an Audio Component to it
- In Audio Component details:
- Set Sound: SC_Footstep
- Set Attenuation Settings: SA_Footsteps
- Enable Auto Activate
- Enable Is Looping (for testing)
Step 19: Test 3D Spatialization
- Play the level (PIE)
- Walk toward the sound source β volume should increase
- Walk away β volume should decrease
- Walk around it β sound should pan left/right
- Move outside the falloff distance β sound should be silent
Step 20: Test 2D Audio
- Create another Audio Component (or modify existing)
- Set Sound to your UI click or ambient sound
- In Details, find Attenuation section
- Uncheck Override Attenuation or leave Attenuation Settings empty
- The sound will play as 2D β same volume regardless of position
β Exercise Complete!
You've successfully:
- Organized audio assets with proper folder structure
- Created Sound Classes for volume control
- Built a randomized footstep Sound Cue with pitch variation
- Set up Sound Attenuation for 3D audio
- Tested the difference between 2D and 3D audio
These foundations will be used throughout your project for all audio needs!
Troubleshooting
β οΈ Common Issues
Sound doesn't play:
- Check Auto Activate is enabled on Audio Component
- Verify the Sound asset is assigned
- Check volume isn't set to 0
- Ensure Sound Class volume isn't muted
3D sound doesn't change with distance:
- Verify Attenuation asset is assigned
- Check that source sound is Mono (not Stereo)
- Increase Falloff Distance if you're not moving far enough
Sound Cue doesn't randomize:
- Verify Random node has multiple inputs connected
- Check that Wave Players have different sounds assigned
- Play multiple times β randomization may repeat occasionally
Sound is too quiet/loud:
- Adjust Volume in Sound Wave or Sound Cue
- Check Sound Class volume multiplier
- Verify attenuation Inner Radius setting
Bonus Challenges
- Surface-Based Footsteps: Create separate Sound Cues for grass, stone, and wood, then switch based on surface type
- MetaSound Experiment: Create a simple MetaSound that generates a tone procedurally
- Reverb Zones: Add Audio Volume actors with different reverb settings for indoor/outdoor areas
- Volume Options: Create a UI slider that adjusts the SC_Master Sound Class volume
- Ambient Layers: Create an ambient Sound Cue that mixes wind, birds, and distant sounds
Summary
In this lesson, you've learned the fundamentals of audio in Unreal Engine. Understanding the audio pipeline, import workflows, and the difference between Sound Cues and MetaSounds prepares you to create rich, immersive soundscapes for your games.
Key Concepts
Audio Pipeline: Sound flows from imported Sound Waves through processing (Sound Cues/MetaSounds) to Audio Components, categorized by Sound Classes, mixed through Sound Mixes, and output to speakers. Understanding this flow helps you troubleshoot and optimize.
Supported Formats: Import as WAV for best qualityβUnreal compresses during packaging. Use OGG for pre-compressed files. Mono for 3D spatialized sounds, Stereo for music and UI.
Sound Cues: Node-based sound processing for randomization, layering, and simple logic. Use Random nodes for variation, Modulator for pitch/volume randomization. Great for footsteps, gunshots, and varied sound effects.
MetaSounds: Advanced procedural audio system with full DSP capabilities. Use when you need runtime parameter control, synthesis, or complex reactive audio. Steeper learning curve but more powerful.
2D vs 3D Audio: 2D audio plays at constant volume (music, UI). 3D audio is spatialized in the world with distance attenuation and directional panning. Use mono sources for proper 3D spatialization.
Sound Attenuation: Controls how 3D sounds behave over distance. Configure inner radius (full volume zone), falloff distance (audible range), and attenuation function (linear, logarithmic, natural).
Sound Classes: Categorize sounds for separate volume control. Create hierarchy (Master β SFX/Music/Voice). Essential for implementing player volume preferences.
Audio Asset Quick Reference
| Asset | Prefix | Purpose |
|---|---|---|
| Sound Wave | SW_ | Raw imported audio file |
| Sound Cue | SC_ | Node-based audio processing |
| MetaSound | MS_ | Procedural audio graph |
| Sound Attenuation | SA_ | 3D distance/spatialization settings |
| Sound Class | SC_ (or Class_) | Volume category grouping |
| Sound Mix | Mix_ | Master volume/effect settings |
Sound Cue Common Nodes
| Node | Function | Example |
|---|---|---|
| Wave Player | Plays a Sound Wave | Source sound input |
| Random | Randomly picks one input | Varied footsteps |
| Modulator | Varies pitch/volume | Natural variation |
| Mixer | Blends sounds together | Layered effects |
| Looping | Repeats the sound | Ambient loops |
Best Practices
- Use mono for 3D sounds: Stereo files cannot be properly spatialized in 3D space
- Import as WAV: Let Unreal handle compression for maximum quality and flexibility
- Stream long audio: Enable streaming for music and long ambient sounds to save memory
- Organize with folders: Separate SFX, Music, Ambient, UI, and Voice audio
- Set up Sound Classes early: Assign all sounds to classes from the start for easy volume control
- Use variation: Random selection and pitch modulation prevent repetitive audio
- Configure attenuation thoughtfully: Match falloff to the sound's real-world behavior
- Test in-game: Audio that sounds good in the editor may need adjustment in actual gameplay
Figure: Audio flows from source files through processing and playback to final mix output.
What's Next?
Now that you understand audio fundamentals, the next lesson covers Playing Sounds. You'll learn how to trigger sounds from Blueprints using Play Sound 2D, Play Sound at Location, and Audio Components. You'll wire up sound effects to gameplay events like collisions, pickups, and player actions.
Knowledge Check
Question 1
What audio format is recommended for importing sound effects into Unreal Engine?
Correct answer: B β Import as WAV for the best quality. Unreal Engine will compress audio during the packaging process based on your platform settings. This prevents double-compression that would occur with pre-compressed formats.
Question 2
Why must 3D spatialized sounds be mono instead of stereo?
Correct answer: C β Stereo audio has separate left and right channels that are meant to play through specific speakers. When you try to position stereo audio in 3D space, the fixed channel separation creates unnatural results. Mono audio has a single channel that the engine can properly pan and attenuate based on 3D position.
Question 3
What is the purpose of the Random node in a Sound Cue?
Correct answer: B β The Random node randomly selects one of its input sounds each time the Sound Cue plays. This is perfect for variationβconnect multiple footstep sounds and get a different one each step, preventing repetitive audio.
Question 4
When should you use MetaSounds instead of Sound Cues?
Correct answer: C β MetaSounds excel when you need runtime parameter control (like engine RPM affecting sound), procedural synthesis (generating sounds algorithmically), or complex reactive audio. For simpler needs like randomization and layering, Sound Cues are easier and sufficient.
Question 5
What does Sound Attenuation control?
Correct answer: C β Sound Attenuation settings control how 3D sounds behave over distance: the inner radius (full volume zone), falloff distance (how far the sound carries), attenuation curve (how volume decreases), and spatialization options.
Question 6
What is the benefit of organizing sounds into Sound Classes?
Correct answer: B β Sound Classes let you group sounds by type (Music, SFX, Voice, Ambient). Players can then adjust each category's volume independently in the options menu. Adjusting a class volume affects all sounds assigned to that class.
Question 7
Which type of audio should be played as 2D (non-spatialized)?
Correct answer: C β Background music and UI sounds should be 2D because they exist "outside" the game world. They should play at constant volume regardless of player position. 3D audio is for sounds that exist at specific locations in the world (footsteps, gunshots, environmental sounds).