Guides Audio Use Audio Mixers

Audio 2 min read Updated Aug 2026

Use Audio Mixers

Audio mixers let you route sounds through named channels such as Music, SFX, UI, Voice, and Ambience. This gives you one place to balance groups of sounds instead of tuning every `AudioSource` one by one.

Every mixer has a Master channel. Other channels eventually route into Master, so you can lower all game audio at once while still keeping separate controls for music, effects, interface sounds, and ambience.

Create a Mixer Asset

In the Assets panel:

  1. Right-click inside Assets/Audio or another suitable folder.
  2. Choose Create > Audio Mixer.
  3. Name the mixer, for example MainAudioMixer.

Double-click the mixer asset to open it in the Audio Mixer window. A new mixer starts with a Master channel. Add only the channels your game needs, then name and tune them in the Inspector.

Add Channels

Open the mixer asset, then use + Channel to add a channel. Select the channel to edit it in the Inspector.

Common channel names include:

  • Music for background tracks.
  • SFX for gameplay sounds.
  • UI for menu feedback.
  • Ambience for looping environmental audio.

Route an Audio Source

Select a GameObject with an AudioSource component.

In the Inspector:

  1. Assign the source's Clip.
  2. Set Mixer to your mixer asset.
  3. Choose the Output Channel.

If no mixer is assigned, the source plays through the default output.

Balance Channels

Open the mixer asset and tune each channel:

  • Volume adjusts that channel's level.
  • Pitch shifts all sources routed through the channel.
  • Pan moves the channel left or right.
  • Mute silences a channel.
  • Solo lets you listen to one channel path while balancing a scene.
  • Bypass keeps the channel audible while bypassing its effects.
  • EQ bands shape low, mid, and high frequencies.
  • Effects stores processing slots and each effect's mix level.

Use the channel options menu in the Inspector to reset a channel back to its default settings.

Route from PHP

Expose an AudioMixer field when a script needs to choose a mixer in the Inspector:

<?php

namespace Game\Scripts;

use Lenga\Engine\Audio\AudioMixer;
use Lenga\Engine\Audio\AudioSource;
use Lenga\Engine\Core\Behaviour;

final class LevelAudio extends Behaviour
{
    public ?AudioMixer $mainMixer = null;

    private ?AudioSource $source = null;

    public function start(): void
    {
        $this->source = $this->gameObject->getComponent(AudioSource::class);
        $this->source?->setOutput($this->mainMixer, 'channel-1');
    }
}

After saving the script, assign Main Mixer in the Inspector. In most projects, it is simpler to choose the output channel directly from the AudioSource component because the Inspector can list the channels from the mixer asset.

Related Pages