kyleneideck / BackgroundMusic

Background Music, a macOS audio utility: automatically pause your music, set individual apps' volumes and record system audio.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

The mechanism behind background music

chunyang-wen opened this issue · comments

BackgroundMusic has an awesome feature which is: it can control the volume of each app.

I am just curious how it achieves this. (It is a pity that I am not familiar with the objective-c, I will do my best to learn it). I have found code in BGMBackgroundMusicDevice.cpp to set and get app volume.

It seems that there is no high level api(or in swift) which we can achieve similar functions. Maybe I am not careful enough to find all the references and resources.

There are paid apps, such as

They can also control the volume of an app. But they require to install a system extension or something similar. BackgroundMusic does not. It is awesome.

So anyone can help me understand how background music achieve this. That would be much appreciated. Docs, links or books are also fine.

Thanks very much in advance.

Some reference: