Change Volume on Mac programmatically

2019-01-26 11:38发布

问题:

I'm looking for a not applescript way to change the system volume on Mac OS X programmatically. I just couldn't find a solution. Anyone any ideas?

回答1:

Take a look at this class:

https://github.com/InerziaSoft/ISSoundAdditions

It can change system volume and make use of CoreAudio API.

An example of usage should look like this:

[NSSound setSystemVolume:0.5]