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:
- Right-click inside
Assets/Audioor another suitable folder. - Choose
Create > Audio Mixer. - 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:
Musicfor background tracks.SFXfor gameplay sounds.UIfor menu feedback.Ambiencefor looping environmental audio.
Route an Audio Source
Select a GameObject with an AudioSource component.
In the Inspector:
- Assign the source's
Clip. - Set
Mixerto your mixer asset. - 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:
Volumeadjusts that channel's level.Pitchshifts all sources routed through the channel.Panmoves the channel left or right.Mutesilences a channel.Sololets you listen to one channel path while balancing a scene.Bypasskeeps the channel audible while bypassing its effects.EQbands shape low, mid, and high frequencies.Effectsstores 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.