

Ever notice how the music fades slightly when a character starts talking in a game? Or how background ambience lowers during an explosion so the impact feels stronger?
That’s audio ducking.
It’s a simple idea: automatically lower the volume of one sound when another important sound plays. When done right, it makes your audio mix feel clean, professional, and intentional.
In this guide, we’ll break down what audio ducking is, why it matters, and how to build a flexible ducking system in Unity.
Audio ducking is a technique where one audio source reduces its volume temporarily when another audio source becomes active.
Common examples:
The key idea is priority. Important sounds get space. Everything else steps back.
Without ducking, sounds compete with each other. Dialogue can get buried under music. Important effects can feel weak.
With ducking:
It’s one of those subtle systems that players don’t notice directly, but they feel the difference.
The best way to implement ducking in Unity is through the Audio Mixer.
Create separate groups for:
Assign each AudioSource to the correct group.
Select the group you want to be lowered (for example, Music).
Add a Compressor effect.
Enable Sidechain and set it to listen to the Dialogue group.
Now, whenever dialogue plays, the compressor reduces music volume automatically.
This method is clean, efficient, and professional.
If you want more control, you can build a custom ducking system using code.
Basic idea:
using UnityEngine;
using System.Collections;
public class AudioDucker : MonoBehaviour
{
public AudioSource musicSource;
public float duckVolume = 0.3f;
public float fadeSpeed = 2f;
private float originalVolume;
void Start()
{
originalVolume = musicSource.volume;
}
public void StartDucking(float duration)
{
StopAllCoroutines();
StartCoroutine(DuckRoutine(duration));
}
IEnumerator DuckRoutine(float duration)
{
// Fade down
while (musicSource.volume > duckVolume)
{
musicSource.volume -= Time.deltaTime * fadeSpeed;
yield return null;
}
yield return new WaitForSeconds(duration);
// Fade up
while (musicSource.volume < originalVolume)
{
musicSource.volume += Time.deltaTime * fadeSpeed;
yield return null;
}
musicSource.volume = originalVolume;
}
}
Call it like this when dialogue starts:
audioDucker.StartDucking(2f);
This lowers music for 2 seconds, then restores it smoothly.
In larger games, you may need layered ducking:
To handle this, avoid directly changing AudioSource volume. Instead, control exposed Audio Mixer parameters.
using UnityEngine;
using UnityEngine.Audio;
public class MixerDucker : MonoBehaviour
{
public AudioMixer mixer;
public void SetMusicVolume(float volume)
{
mixer.SetFloat("MusicVolume", volume);
}
}
This gives you centralized control and avoids conflicts between systems.
Never instantly drop volume. It feels unnatural.
Use:
Even a 0.2-second fade makes a big difference.
How much should you reduce volume?
Too much ducking feels dramatic. Too little feels pointless. Test with real gameplay.
Audio ducking is lightweight, but follow good practice:
Most performance cost comes from too many active AudioSources, not ducking itself.
Keep it controlled and predictable.
Use ducking when clarity matters.
If your game relies heavily on atmosphere and music, ducking becomes essential.
Audio ducking is about focus.
It tells the player, “This sound matters more right now.”
Whether you use Unity’s Audio Mixer sidechain compression or build a custom script-based solution, the principle stays the same: give important sounds space.
Keep fades smooth. Keep levels balanced. Test with headphones and speakers.
When mixed properly, your game won’t just look professional. It’ll sound professional too.