Change Volume on Aggregate Sound (Mac OS X)

Gurhan Polat
3 min readDec 20, 2020

--

Hi everybody,

If you want to connect 5.1 surround sound system on Mac OS, you need to create an Aggregate Device. Once you have created an Aggregate Device, you add some sub sound devices (outputs) under it, in order to configure it correctly

Below is the picture of my configuration

and the configuration of my speakers

But there is some big problem with Mac OS which it does not allow you to control the volume of the sound. Yes, it is real and should be considered as a shame.

If you want to decrease or increase of the volume, you need to open Audio MIDI Setup, walk through all the sub sound devices, and equally set all the channel sounds by yourself

Anyway there are some tools like https://staticz.com/soundcontrol/ or https://github.com/mattingalls/Soundflower/releases/ to give the ability to control the volume, but these are huge projects. We just need to decrease the volume but we need to install a tool where all the sounds flows into it! It is horrible. And also, i tried soundcontrol which is very sluggish and slow, even make some distortion while heavy load.

So i decided to make a terminal tool which you can get current volume of the Aggregate Device, which also you can set each of the channel contained in the Aggregate Device.

This is my first swift Mac OS development, there should have been so much wrong with my code, but here the main point is not the code itself, I'm sharing the idea just because I could not find such an approach on the internet even i’m searching for months!

Here is the code

As an explanation, the code does

1-) Get default audio output device

2-) For each sub devices of it

3-) Get or set left and right channel volume.

Lets try it out

I’m leaving the executable link here for whom who dont want to compile it itself

Edit: I have created a popover app to adjust the volume of the aggregate sound device.

Here is the gif while it’s working

You can also use VolumeUP, VolumeDOWN, VolumeMUTE buttons to control the level of the volume.

Source code available here

And you can find the executable at

Thank you, happy coding

--

--